cancel
Showing results for 
Search instead for 
Did you mean: 

Logon Error for Crystal Report Viewed by User When Not Included In App

Former Member
0 Kudos

I have a Visual Basic 2008 SP1 application and I'm using Crystal Reports 2008 SP0 (with FP1 + 2). I have about 50 reports using integrated security that are all "embeded resources" in the application. When I want to print one of these reports I use code like this:

PrintReports(New MyEmbededReport)

And in my PrintReports routine it just creates a new instance of a form that has the report viewer control on it and passes the report over to it. This works GREAT and I can embed all my reports right into the app and call them when I need them.

Recently however I've had the need to add some custom reports that may change more often then the app changes so I need a way for users to access their reports without a new version of the app being pushed out. So I made a routine that lets me store the actual Report.rpt file into SQL and when a user goes to run it the report is pulled out of the database and saved into their temporary files and then passes it back to my PrintReports routine as a ReportDocument. This also works fine but only on my machine. On the client machines it asks for the login information and no combination will work. I've tried multiple ways of getting around it and have spent hours trying examples found on the internet including assigning the login information before preview, running through and assigning the login information to each table, I've gone through the "Using Integrated and SQL Autentication in .Net Applications" guide, turning on and off integrated security. Nothing seems to work.

What else is there to try? As a very last resort I will have to store the reports into the app like the other ones but I'm really trying not to do this.

-Allan

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

I think the simplest and possibly quickest way to find out what's going on, will be to install the CR designer on the user's computer - just for testing purposes. The you can load the report into the designer from the "temporary files" that you saved it to and see if the report runs there. You will either get an error, possibly a better error than at runtime, or the report will work. Either will be a good piece of the puzzle. If you wish, you can download an eval of CR 2008 from here;

http://www.businessobjects.com/forms/default.asp?id=701600000009BXP

Ludek

Former Member
0 Kudos

Ludek,

Your suggestion helped a little although now I'm more confused. I installed CR2008 onto a client machine that logs in with a different login them myself and then ran my app. I launched the report form within my app and watched as it added a "ReportFromSQL.rpt" file into the temp directory (name is example of course) and popped up the login screen. I then made a copy of this file and closed my app (and it deleted the original as it should). So I opened up the copy in CR 2008 and it opened fine. I then clicked Preview and it popped up the "OLE DB Provider - Select a provider form the list or select a data link file." screen. If I select "Microsoft OLE DB Provider for SQL" then pick the server, click "Integrated Security", and click the database it works fine. It's like the report lost it's connectiong information if thats possible?

Not sure if this matters also....all the reports that are part of the app were built within VS2008, these extra reports that are being put into SQL were built within CR 2008. Is there some way they're losing there connection info and if so I how do I prevent this?

-Allan

Answers (7)

Answers (7)

Former Member
0 Kudos

See last post

Former Member
0 Kudos

I am hoping I can get some help here. I have a similar problem (with pop up window login info for report, even though it never did this before I patched it to 11.5 version).

I have some reports that have this, and others that don't, I am still a newb when it comes to crystal, having used componentone myself in the past, but since being here (almost 2 years) in this company...we've never had these problems.

Then we updated a few weeks ago to 11.5 (no choice vs2005 upgrade from vs2003 too).

I started seeing many reports (not all though) that would pop this login window...

and being that not all reports has this, although the base class report generator is the same code everywhere....I had no leads.

I saw this post and thought, great, finally an answer...but to my dismay, I see that all my reports have the ADO.NET XML set as the main acces type for the reports. I even went and found more info concerning the settings on the report itself (which made sense seeing as some programmers here may have opened up the projects and modified something...which would account for why only certain projects have the problem but not all).

How do I diagnose this problem. In componentone, we could assign a connection string to the report, and this would be in the header of the report....if it was blank, then you would have to set it manually.

I know that we use an inhouse connection object (which again is the same for all) so I would bet that this is not the problem. We do not give reports their own connections, we use a generic connection

I guess I would like to know from 1 version to another, was there something that happened to reports or projects that set parameters(default?) for flags affecting the way the report connected...???

Edited by: landerson on Mar 19, 2009 3:35 PM

former_member183750
Active Contributor
0 Kudos

From your description, it looks to me like you are using ADO .NET datasets. Typically, the issue of database logon when using datasets is related to the report not understanding the dataset. E.g.; something is different in the dataset or unexpected. To troubleshoot these issues, see [this|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13270] [original link is broken] [original link is broken] [original link is broken]; blog.

Ludek

Former Member
0 Kudos

I notice that there is no real update guide from 11 to 11.5 as to what changed, and what could cause my reports to suddenly ask for logins as before they were not. As I suggested, this could also be because certain people worked on projects, of which affects only those projects, and then leaving the rest of the reports to not have the same problem.

Former Member
0 Kudos

Also noticed, while breaked at a point int he code, I verified that the dataset had its information....which it did, then I used the Report.SetDataSource(myDataset),

then set the CrystalReportViewer.ReportSource() = Report

then did a CRViewer.ShowDialogue and it pops up the login.

If I have my info already and just pass it in with a dataset (using setdatasource) then I should not have to worry about db connections as I need none....why would it pop open the window if I already passed it the info....no need to get anything else.(I see the info in the dataset viewer in vs2005, so I know its there)

former_member183750
Active Contributor
0 Kudos

I know. But the only way to troubleshoot this will be to follow the direction in that blog. Honest. Let's see what happens there.

Ludek

Former Member
0 Kudos

I tried writin to xml, and found that certain data would be lost because formula code can not compile.

However, this was not the case in 11.0 version. Is there anything that changed from 11 to 11.5 that would cause the designer to inform me of this?

Seems to me, there should be a list somewhere of what got changed from 11 to 11.5 that way it could explain my situation?

Edited by: landerson on Mar 19, 2009 8:37 PM

Former Member
0 Kudos

Is there not a breaking changes list for 11.5 from 11, that we could use to help us know what could have broken?

former_member183750
Active Contributor
0 Kudos

I'm not aware of any changes along those lines. A formula that worked in CR XI r1 should work in CR XI r2. Make sure you have the latest SP for CR XI r2 from here:

https://smpdl.sap-ag.de/~sapidp/012002523100013876392008E/crxir2win_sp5.exe

and other than that, I would tend to argue that it is the back end data that changed (format, etc.) that is the issue. I suppose one way to test that would be to take the xml to a CR XI r1 machine and see what happens there(?).

Ludek

Former Member
0 Kudos

That is what I will be doing (VMWare is great for that) using an imgae of ours here before we updated to those versions of 11.5, and will check back with you with the results. I have sp3 by the way for 11.5

former_member183750
Active Contributor
0 Kudos

Understood and appreciated. It really will be the best test at this point in time. Do ensure that your CR XI r1 is patched to SP 4:

https://smpdl.sap-ag.de/~sapidp/012002523100006008952008E/crXIwin_sp4.zip

And CR XI r2 should be at SP5:

https://smpdl.sap-ag.de/~sapidp/012002523100013876392008E/crxir2win_sp5.exe

Ludek

Former Member
0 Kudos

Marked Unanswered again as after more testing it's still doing it.

The refresh method seemed to work but it doesn't work for reports that have custom perameters in them. If I pass the perameters as a SQL query the reports work but the ones that prompt the user do not.

For example I have a report that prompts the user for a start and end date range to run a report off of. They open the report and it has the start and end date range that was in there wen I made the report (because if I uncheck save data with report it loses the connection info...). So they click the parameters panel and they change the start and end dates. As soon as they click the Apply button they get the login screen. WHY?!?!?!

-Allan

former_member183750
Active Contributor
0 Kudos

That sounds more like a postback issue(?). If you think that is a possibility, search the forum for postback and / or session. There are a number of posts here that may help. Also search this forum for the same:

Ludek

Former Member
0 Kudos

Did a search on PostBack and didn't find much that was related, majority had to do with asp/web applications. However after more testing I think I've narrowed it down to being the parameters fault. The two reports that arn't working both have the start and end date parameters. So when the report runs I hit refresh and it gives me the login box. I hit Cancel. It gives me the login box again. I hit cancel again and it goes back to a blank report screen. I said it can't be a coincidence that I have two parameters and it prompts me for a login twice. So I deleted one of the parameters and updated the quert to just pick stuff greater then the start date (deleted the end). Ran the report on the client machine, it loaded the saved data. Hit refresh and it prompted me for a login. Hit cancel and back to a blank screen.

So all the login issues are with the Parameters. It doesn't seem to be a CR problem. The problem is if I bring it into CR and uncheck the "Save data with report" then it has to prompt for that data and when it does it pops up the login screen. In VS it just is saving the data so I don't see the login until a refresh.

So why are my perameters asking for a login and how do I get around that?

Former Member
0 Kudos

So this is definately the issue....doing a "save data with report" lets the report work fine on the client machine but they can't update parameters and when they do it asks for login info, which never works. I've tried setting login information for the report viewer control, setting it in the refresh properties, tried deleting and recreating my parameters, tried using Static instead of Dynamic parameters but if the user refreshes the report it still tried to logon. Found a similar thread which unfortunately has no replies:

Any other ideas?

former_member183750
Active Contributor
0 Kudos

Maybe looking to see if any of our sample apps work on your computer will be the way to go here. The file at this link:

https://smpdl.sap-ag.de/~sapidp/012002523100006252822008E/net_win_smpl.exe

contains a number of sample apps. Look for VBnet_win_multirangeparams, VBnet_win_paramengine and VBnet_win_sub_daterange_param_engine

Oh, not sure if I gave out this link before:

http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf

But that may be a good place to look also.

Ludek

0 Kudos

Hi Alan,

The problem is Cr 2008 has new features that the CR .NET Basic version does not. This is a version issue. CR 2008 uses version 12.0 components and CR for .NET 2008 uses versions 10.5 of our runtime. CR 10.5 does not support the new features in CR 2008 which explains why you see missing options in the report Options menu. .NET 2008 is CR Basic, it's limited in it's functionality.

In your application remove all the 10.5 assemblies and add in all the 12.0 included with CR 2008 Developer version.

Also SP1 is now available for download for CR 2008 which you can download from this link:

https://smpdl.sap-ag.de/~sapidp/012002523100010503722008E/cr2008_sp1.exe

You should now be able to use your reports and your customers Cr 2008 designed reports.

Thank you

Don

Former Member
0 Kudos

Don - I never had Crustal Reports Basic on this machine. I had XI R2 and then uninstalled that and installed CR 2008 SP0. My version of VS is VS 2008 Standard, it did not come with CR basic. All my refrences in my app show as 12.0.2000.0 or 12.0.1100.0 so that also isn't a issue. I'll download the SP1 and install anyway just to be on the safe side...maybe it will fix the options issue. Otherwise there is still something in the perameters I have to figure out.

Ludek - I downloaded both the walkthrough and the sample apps. Unfortunately the samples dont seem to work....there are instructions for upgrading them to your version of CR/VS but nothing is mentioned of CR 2008 / VS 2008. The main issue is the data source each project refers to doesn't exist...it says to refrenced the developers tools directory of CR but my directory is empty....maybe it was a option I didn'tt check during installation and I'll go back and look into that, otherwise it's not included in the 2008. Either way it's probably something to do with that postback thing and requiring a login to get the parameters to refresh the report as all my other reports without perameters work fine with the refresh in there.

-Allan

0 Kudos

Hi Allan,

Sorry I thought when you said you designed within .NET you were using the 10.5 version.

We don't ship the sample reports anymore, you can download them from the startup page of CR designer or click on this [link|https://smpdl.sap-ag.de/~sapidp/012002523100006010272008E/feature_smpl.zip].

There are others so log in and search on Samples and you should find them.

Thanks again

Don

Former Member
0 Kudos

Seems the SP1 doesn't install the updated SP1 runtimes file (CRRuntime_12_1_mlb.msi) so after installing SP1 your application will yell about missing the update and you need to go download the updated files.

On a side note I now have a "Save Data With Report" option on each report inside VS 2008 when I put the report into preview mode. Its up in the top left corner of the preview window. Flip side of this is I'm still missing the 4 or 5 other options from the report options screen.

I'll download the samples and see if I can get something working.

Former Member
0 Kudos

Where is the SP1 runtime files for Click once deployments? Tried going here:

https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm

But only the old files are listed. How do I download the CRRuntime_12_1_mlb.msi, where is this file? Has it not been released yet and if not how do I deploy my ClickOnce app as VS is complaining it's not found:

The install location for prerequisites has not been set to 'component vendor's web site' and the file 'CrystalReports 12.0\CRRuntime_12_1_mlb.msi' in item 'Crystal Reports 2008' can not be located on disk. See Help for more information.

0 Kudos

Hi Allan,

The click once deployment package has not been released yet for SP1, they are working on the merge modules also. You can get the MSI from this link:

http://resources.businessobjects.com/support/downloads/redistributables/cr_120/redist/x86/CRRuntime_...

Thank you

Don

Former Member
0 Kudos

I still have no solution to this issue and I'm actually quite surprised no one else has this problem as what I'm doing isn't that far fetched....letting a user change parameters of a report within a ReportViewerControl in a VB app. Since my last post in here I have gotten a new laptop, installed a fresh copy of Visual Studio 2008 SP1 and Crystal Reports 2008 SP1. Opened the same reports, made sure they work on my PC, saved them, and get the same problem on the end user machines. For each parameter value I ask for I get a login box. If there are no parameters or I pass over a query using .RecordSelectionFormula it works great but if I use a parameter it will prompt for login information and nothing entered will work. Using the same reports that I have issues with I can change the parameters to a passed query and its fine but that defeats most of the purpose of designing reports the user can just change and update on there own.

Does anyone else have any ideas? Should I have some type of login code in the report refresh property of the report viewer? I tried walking through samples and looking up issues with persistance and none seemed to fit this issue, although I tried some anyway.

Former Member
0 Kudos

Marking as answered because I'm back to being functional and the workaround is repeatable. Still not sure what CR does to ruin my reports but at this point it's not worth figuring out. Thanks to Ludek for his suggestions.

Former Member
0 Kudos

Thank-you for your replies Ludek, the've been very helpful in guiding me twords a resolution. Unfortunatly it looks as though CR's integration with VS is the problem with the "Save data" checkbox and I have no idea why CR standalone is breaking my reports. With that said I put the .Refresh method into my VB program right before the form that holds the report control is displayed and it's now correctly refreshing the parameters. Here is what I'm talking about in CR/VS:

Crystal Reports 2008 SP0 FP 1&2. Open a report, go to File -> Report Options and I get this:

http://support.whgardiner.com/temp/ReportOptionsInCR2008SP0.jpg

Visual Studio 2008 SP1. Open a report within VS, go to Crystal Reports -> Report Options and I get this:

http://support.whgardiner.com/temp/ReportOptionsInVS2008SP1.jpg

Bunch of options just disappear including the one I need. So with your suggestion I at least have a work around although building reports within VS instead of with CR seems odd....I guess it gets the job done though.

-Allan

Former Member
0 Kudos

Anyone have any other ideas on this? The reports, now recreated from within Visual Studio, are working fine except I need to be able to uncheck the "Save Data with Report" but that option is not available within Visual Studio. Is this a bug, should it be there? As mentioned if I open my report in Crystal Reports and turn the option off and save it the connection info gets messed up so I need to be able to turn off the option without opening it in CR, just in VS.

-Allan

former_member183750
Active Contributor
0 Kudos

It worries me when you say:

"As mentioned if I open my report in Crystal Reports and turn the option off and save it the connection info gets messed up so I need to be able to turn off the option without opening it in CR, just in VS. "

Something is most definately seriously messed up on that computer. Or I'm not reading this correctly. It may not be a bad idea to cross post to the Report Designer forum, describing the above in as much detail as possible. They may try to push back to here, so make sure you tell them that this is a CR stand-alone issue...

As far as removing "Saved data". Use the .refresh property off the report object.

Ludek

former_member183750
Active Contributor
0 Kudos

I've done a bit more asking for advice around here. Pretty consistently, the advice is:

"...this is now getting to a point of being too much for the forumu2026. obtaining a support case will be a good idea"

If you are interested in obtaining a support case see the following:

http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryI...

Ludek

Former Member
0 Kudos

Fixed this. Somehow these two reports had the database driver as the ADO SQL Native driver (SQLNCLI) instead of the OLE DB driver for SQL (SQLOLEDB). Doing a "Set Database Location" on both reports and switching it to the correct source fixed the issue. I still don't understand how this happened to 2 of 40 - 50 report files.

So this is finally fixed.

Former Member
0 Kudos

Ok....I recreated all of my reports within VS2008 and then put them into the SQL database. I went to my client machine, ran the report from there, it worked just like all the other reports....no prompting for a user login or connection, just ran like it should. Unfortunatly it didn't prompt for my parameters...must have left the "save data with report" option checked. So I look through VS and I can't find that option in the options screen...it's like its just not there. In fact the first 5 or 6 options in the second column of the report options arn't there. So I opened one of the reports in CR 2008, turn off the option, hit save, and copy it back and now it DOESN"T work. As soon as CR 2008 touches the file the connection information gets messed up. If I create it only within VS 2008 it works fine.

Anyone have any idea why this would be and if not how do I turn off "Save data with Report" from within VS 2008 so I can at least create everything there or how to make the report prompt for the parameters with that option turned on?

Also as a side note, not sure if this is a bug or not, if you make ANY change in VS 2008 and save a report the "Save Data with Report" gets turned back on yet that option doesn't show up in the report options within VS so you can't manually turn it off.

-Allan

Edited by: Allan Dynes on Oct 8, 2008 5:29 PM to update status.

former_member208657
Active Contributor
0 Kudos

Did you check and see what Integrated Security is set to when you look at the Properties of the connection in the Set Datasource menu? It should be true. You can also force the report to use Integrated Security by using the SetConnection method on the IConnectionInfo class.

It would look something like this. Please note this is freehand code so I haven't checked it against a compiler.

IConnectionInfo boConnectionInfo;

boConnectionInfo = boReportDocument.DataSourceConnections[0];
boConnectionInfo.SetConnection("DB Server", "DB name", true);

https://boc.sdn.sap.com/node/9711

If this doesn't work then you should use SQL profiler to find out what your SQL server is seeing coming in. It should be able to tell you what logons are being attempted.

Former Member
0 Kudos

Integrated Security was set to True for the report and I've tried multiple times to manually set the connection information through code (see first post). It really seems like the report is not saving the connection information....why else would it prompt for it when you try to preview it?

-Allan

former_member183750
Active Contributor
0 Kudos

Something is not adding up here...

Couple of things to do:

1) Open the report on the dev computer, in the CR 2008 designer. (e.g.; do not open up the report from once it is saved to the temp location from your app). You will find the actual .rpt file in your app bin directory. Once the report is opened in the designer, go to the Database menu and select "Set DataSource Location". What does it say for "Database Type" when you expand the "Properties"?

2) Copy the above report (the one from your app bin directory) to the client computer and open that up in the designer on that box. What happens now?

Ludek

Former Member
0 Kudos

1) Screen looks like this:

Current Data Source

 - report
  - SQLServer
    + Properties
      + vMyViewForTheReport

Replace With:

- My Connections
  + SQLServer
+ Create New Connection

If I click the plus sign in front of SQLServer under the Replace With box it expands down to my database and then furthur expands down to my tables and views.

2) Opening the same source file on the client machine I get the exact same thing. HOWEVER if I click on the pus sign in front of SQLServer under the Replace With box I now get the "Select a Provider..." dialog. Again if I select the right provider, even with integrated security, it works. But why it is "forgetting" the connection?

-Allan

Edited by: Allan Dynes on Oct 6, 2008 9:04 PM because the forums destroyed my layout...

former_member208657
Active Contributor
0 Kudos

It sounds like you are attempting to use a Native SQL driver. I'm actually not sure how that is an option because we dropped native SQL drivers a while ago. I suggest to use the OLE DB driver and specifically select the "Microsoft OLE DB Provider for SQL Server". This has always worked for me.

Former Member
0 Kudos

Sorry, tried to edit my post but guess it wount let you save if someone already replied. The Database type is already OLE DB (ADO) and it does list integrated security.

-Allan

Former Member
0 Kudos

Just trying to get this working. My PrintReport routine used to just have the single line to assign the passed report to the report viewer.report source property. I've changed it to this:


            Dim crtableLogoninfos As New TableLogOnInfos()
            Dim crtableLogoninfo As New TableLogOnInfo()
            Dim crConnectionInfo As New ConnectionInfo()
            Dim CrDatabase As Database
            Dim CrTables As Tables
            Dim CrTable As Table
            'Set the ConnectionInfo properties for logging on tothe Database
            With crConnectionInfo
                .ServerName = My.Settings.SQLServerName
                .DatabaseName = My.Settings.MainDatabaseName
                .IntegratedSecurity = True
            End With
            'This code works for both user tables and stored procedures. 
            'Set the CrTables to the Tables collection of the report
            CrDatabase = myReportFileName.Database
            CrTables = CrDatabase.Tables
            'Loop through each table in the report and apply the LogonInfo information
            For Each CrTable In CrTables
                crtableLogoninfo = CrTable.LogOnInfo
                crtableLogoninfo.ConnectionInfo = crConnectionInfo
                CrTable.ApplyLogOnInfo(crtableLogoninfo)
            Next
            'Set the viewer to the report object to be previewed.
            PrintPreview.CrystalReportViewer.ReportSource = myReportFileName

And I have the exact same issue....my internal reports stored within the app still work fine for everyone but the custom reports made in CR2008 and added as files still do not.

So out of fustration I added one of the "external" reports into VB 2008 and opened it in there, did a verify database, saved it, and then added it to my SQL server but again same issue....it's like when its off of my computer it "loses" the connection information even though it still shows its there. Not sure why the reports that are embedded into the app don't have this issue.

So that gave me another idea. I took one of the reports that was originally created in VB2008 and took that and put it into the SQL then ran that like the others and IT WORKS. It creates the temp file on the client PC and runs it from there with no login issues. Now I'm more confused....any ideas? I guess I'm going to start recreating the reports I created in CR 2008 and remake them in VS 2008 since those seem to work fine but why should I have to....what would be the difference?

-Allan

former_member208657
Active Contributor
0 Kudos

Does the code you posted above work? Can you preview the report without prompt using it?

Former Member
0 Kudos

No...the code doesn't help. I've also tried passing userID and password using the connection info and that doesn't work, even when using a ID that has SA on the SQL. Again....if it was created within Visual Studio 2008 and distributed the report works fine, if it was created on my machine with Crystal Reports 2008 directly the report only works on my machine and asks for a login on any other machine.

-Allan