Showing posts with label displays. Show all posts
Showing posts with label displays. Show all posts

Friday, March 23, 2012

Replace LoginName control with other data fields from aspnetdb.mdf

I currently have a LoginStatus and LoginName control on my asp.net 2.0 master page. When successfully logged in a message displays "You are logged in as" LoginName. Since I am using the user's e-mail address as the UserName the message will display as "You are logged in as johndoe@.foo.com".

What I want to do is have the message display as "You are logged in as " FirstName LastName. FirstName and LastName are two new fields that I added to the table, aspnet_Users.

What I have done is to use the FormView control to display FirstName and LastName; however this always displays the first record in the aspnetdb database.

Is there a cleaner way (than the FormView control) to display the requested data, using the currently logged in user? I have access to Microsoft Expression Web and Visual Studio 2005, but I prefer Expression Web.

Thank you in advance

Hi,

From your description, it seems that you want to get the FirstName and LastName field for the logon user, right?

If so, I think you can get the current user's name by using User.Identity.Name, and then, invoke the GetUser method of Membership with the current user's name, which can return a MembershipUser typed object. You can access the data filed in the membership tables.

Thanks.

Monday, March 12, 2012

Repeated Value

Hi I have a query that displays 5 column but I would like to supress the repeated values from one of them...

like this

__Event___|___Reference___|___Name___|____Date____ _|
________1_|__AB01000005__|__Diogo____|__01/01/2005_|
________2_|__AB01000005__|__Diogo____|__02/01/2005_|
________3_|__AB01000005__|__Diogo____|__03/01/2005_|
________4_|__AB01000001__|__MAria____|__04/01/2005_|
________5_|__AB01000002__|__Joao_____|__05/01/2005_|

this table is what I am getting
I want it to return this

__Event___|__Reference____|__Name____|___Date_____ __|
_______3__|__AB01000005__|__Diogo____|___03/01/2005_|
_______4__|__AB01000001__|__Maria____|___04/01/2005_|
_______5__|__AB01000002__|__Joao____|____05/01/2005_|

This way I only get the latest reference....

There is any way to do this?select Event
, Reference
, Name
, theDate
from yourtable as t
where theDate
= ( select max(theDate)
from yourtable
where Reference = t.Reference )|||That does not seem a good solution since I am using 3 tables to get the values
if you have another ideia I would apreciate|||What is the difference between this problem and your other one entitled "Can't Use Distinct Here"?|||guess this one is less detailed....

Oh if you don't mind... I have 2 tables... one as all the references as text, and the other only have the used ones....

I wantes to query all of the references that are not being used...

I think this one is easy but I am a newbie at SQL!!!

guess you can tell me how to do it :)|||guess you can tell me how to do it :)actually, we would prefer that you do a little bit of this work yourself ;)

hint: left outer join|||I've been trying something like this

SELECT Badges.BadgeReference
FROM Badges, Visitors
WHERE (((Badges.BadgeReference) Like Not[Visitors].[VisitorReference]));

And it does not work
then I tryied

SELECT Badges.BadgeReference
FROM Badges LEFT JOIN Visitors ON Badges.BadgeReference = Visitors.VisitorReference
WHERE (((Badges.BadgeReference) Like Not [Visitors].[VisitorReference]));

Nothing... and finally

SELECT Badges.BadgeReference
FROM Badges Right JOIN Visitors ON Badges.BadgeReference = Visitors.VisitorReference
WHERE (((Badges.BadgeReference) Like Not [Visitors].[VisitorReference]));|||oooooohh... forget... outer joins... I'll be trying
hehehe|||ok guess I didn't make it....
:( what a failure!!!!|||...

I can only get the ones that I am using and not the inverse... :(|||keep looking , you are almost there

what are you using as a reference for left outer join?

textbook? tutorial web site?|||I'm trying by myself, and searching for something on the internet...|||SELECT Badges.BadgeReference
FROM Badges Left Outer Join Visitors On Badges.BadgeReference = Visitors.VisitorReference
WHERE Badges.BadgeReference <> Visitors.VIsitorReference

I've reached here...... It returns nothing... it was suposed to return 1,2,3 and 4, the 5 was being used...

if I take off the where it shows all the references including the 5 and I don't want it to do it....

Getting desperated with this one|||you need a good SQL tutorial

there are several on my SQL Links (http://r937.com/sqllinks.cfm) page

meanwhile, in a LEFT OUTER JOIN, rows from the left table which have no matching row in the right table are still returned in the results, but the columns from the right table are all null

therefore if all you want is the unmatched rows,

SELECT Badges.BadgeReference
FROM Badges Left Outer Join Visitors
On Badges.BadgeReference = Visitors.VisitorReference
WHERE Visitors.VIsitorReference is null

:)

Monday, February 20, 2012

Renders with missing data

Anyone seen a situation where a report displays fine using VS.net, but when
you go to render via HTML -- the data shows up incomplete, it has blank cells
in the table'
Any ideas?
Confused as all heck --
JimHello, Jim.
I would assume that your HTML is correct and that there is blank data.
In VS.Net when you use Preview it actually grabs a copy of the data and
caches it for all subsequent previews. So your preview may be working
off older data while your HTML view is going to be working off live
data.
To test this you can delete your cache file. In the directory where
your report.rdl file is there should be another file called
report.rdl.data. Delete this file and the Report Designer will be
forced to rerun the queries.
Regards,
Shane
Jim_OLAP wrote:
> Anyone seen a situation where a report displays fine using VS.net, but when
> you go to render via HTML -- the data shows up incomplete, it has blank cells
> in the table'
> Any ideas?
> Confused as all heck --
> Jim|||Shane,
It actually had to do with security on the cubes, once I opened the
securityfor the cubes -- the data magically popped showed up!!
Thanks,
Jim
"ShaneC" wrote:
> Hello, Jim.
> I would assume that your HTML is correct and that there is blank data.
> In VS.Net when you use Preview it actually grabs a copy of the data and
> caches it for all subsequent previews. So your preview may be working
> off older data while your HTML view is going to be working off live
> data.
> To test this you can delete your cache file. In the directory where
> your report.rdl file is there should be another file called
> report.rdl.data. Delete this file and the Report Designer will be
> forced to rerun the queries.
> Regards,
> Shane
> Jim_OLAP wrote:
> > Anyone seen a situation where a report displays fine using VS.net, but when
> > you go to render via HTML -- the data shows up incomplete, it has blank cells
> > in the table'
> >
> > Any ideas?
> >
> > Confused as all heck --
> >
> > Jim
>

rendering pdf files with expressions in header or footer

I have a quite complex report with a header and footer (displays on every
page) that must be renedered as pdf. In the body I have a table within a
list. This works well and is relatively quick with SP1. However if I add any
expression to a field in the header or footer the pdf file takes 4 minutes
to generate (vs 10s without the expression). For instance, if I add the page
number to the header it will take 4 minutes to generate. I have not
experienced this problem with any other report. Any idea what is causing
this?
ThanksA bit more info on this. I've discovered that it only happens where I have a
table within a list and the grouping on the list is done on a field with a
large number of records. It renders fine in html, but it adds up to 4
minutes for the pdf generation. If I remove the expression from the header
it is fine. If I add a textbox with a value of ABCDEF - no problem. But if I
change that to ="ABCDEF" - very slow pdf generation.
Thanks
"Werner van der Merwe" <wernerv@.nvisionit.co.za> wrote in message
news:egWT8fKcEHA.3988@.tk2msftngp13.phx.gbl...
> I have a quite complex report with a header and footer (displays on every
> page) that must be renedered as pdf. In the body I have a table within a
> list. This works well and is relatively quick with SP1. However if I add
any
> expression to a field in the header or footer the pdf file takes 4 minutes
> to generate (vs 10s without the expression). For instance, if I add the
page
> number to the header it will take 4 minutes to generate. I have not
> experienced this problem with any other report. Any idea what is causing
> this?
>
> Thanks
>