I designed a report in crystal report v13. Steps that i followed are,
create a system dsn for Mysql with database details in
administration tools.
go to crystal report, click on database->database expert->create new
connection -> odbc -> new connection and selected the dsn I created.
When the connection is added i clicked on add command and added my report command.
Then Designed the report.
loaded and printed report using C#
once I designed the report tested with printing , I moved my report file(.rpt file) to another PC.Printing through C# in this system Failed(Blank Report).Then I opened up the report in crystal report in this system and previewed.The Report was Blank.
So I Followed first two steps Which I did in My PC(above mention step 1 and 2).
Then again I preview it. The Report Was Blank With no details from database but other skeletal structure was present(I mean except values from database).
What did i Do Wrong Here?
I had to do step 3 and step 4 again in this PC. Designing the report in every system I transfer the report file is pathetic. Can Anyone Tell Me what step i am missing here?
Related
I need to create a Crystal Report and have to set Datasource location pointing to Development, Testing and Production servers. The created crystal report will be placed in database table and fetched at the time of report generation by passing the credentials(Development or production). But whatever Datasource given at the time of creation it is pointing to that only cant able to change the datasource through the code.
Please help me in this. I need a Crystal Report generated with multiple datasource connections.
In C# I have written code as shown below:
oReport.SetDatabaseLogon(gcUser, gcPassword, gcDB, gcDB);
oReport.DataSourceConnections[0].SetLogon(gcUser, gcPassword);
You cannot create 1 report with multiple saved connections. You can apply the connection on the fly in your code, when running the report or you can save multiple reports, which will differ just by the connection. There are some tools , which can be used to replace report's database connection. This one http://r-tagsoftware.com/Pages/CrystalDataSource can process single report for free
I created one application in C# .Net for viewing crystal report.
But when i try to execute,it shows "load report failed" error message.
May i know the reason.
And what are the viewer files to be install for viewing report.
Developed the report in Crystal report 2008.
This usually happens. Try the following
Check your code. Try this here
Check your data table name and column names. They needs to be the same (case insensitive) as that of database
Check your database connectivity.
Check if you have any spelling errors in your code that specifies the name of your report file.
Check if you have installed all the right components for crystal report to work
Open crystal report and try to update connection to your data source
Try debugging by removing all fields and blankly showing the report. If it works, it should be problem with your code else it could be problem with crystal report or connectivity.
Let me know if any of this works for you
I would like to know if exists the way to send a crystal report directly to the printer without print dialog. Ex. I have an asp.net page with a crystal report viewer and I want send to print once the report have been loaded into the viewer.
I saw an application what it is doing that but I don't know how that work.
I am using
Visual Studios 2010
Crystal Report for .NET Framework (Version=13.0.2000.0)
C# 4
if have a code sample (will be great!!!!)
I have read lot of resources in internet but nothing give me idea how to do what I need.
Thanks in Advance.
J.S.
It does not working like you think. Method PrintToPrinter generates printout directly to printer. Report preview also do the same. If you are executing both methods then report is generating twice. If you have more pritnout pages then report preview generates only visible pages. In most cases this does not change anything, but if report is generating a lot of time, then you are getting a lot of resources from system and you can expect deadlock on database. You also have to remember that if your report is generating new data per each executing then you will have doubled data.
Good I did it
I Just set this values to the ReportDocument.
CrystalReportDocument.PrintOptions.PrinterName = "Printer Name";
CrystalReportDocument.PrintToPrinter(1, true, 1, 1);
anyways I am open to other ideas and suggestion.
When I print my crystal report, it will not print the correct (most recent) database view. To get it to print the correct one, i have to manually select "set datasource location" and then click on the tables i want and then click update. If i don't it will keep printing the same old view over and over.
I do have the "verify on every print" option selected but it doesn't seem to work.
I am using VS2010 with the beta crystal reports for vs2010 and ODBC 5.1.
Thanks
It sounds as though you have the Save Data with Report option enabled. Try opening the report in the report designer, and see whether there is a tick on the File menu next to the Save Data with Report option - if so, uncheck it, save the report and try again.
We've created a Crystal Report viewer application to house all of our company reports. It's built in such a way that any time we add, modify or delete a report, the viewer application itself does not need to change. The viewer app is completely driven by an XML configure file that tells it what reports are available, where they are, connection information etc. We want to keep it this way too. When we add a new report, we don't want to have to update everyone's viewer application.
The problem is that Crystal talks to our DB directly and we would prefer it didn't. Therefore, for each report, the viewer needs to query the database to retrieve the data each report needs. The problem is that many of our reports allow the user to enter a large number of filter criteria. Ideally, what we would like to be able to do is to have Crystal prompt the user to enter their filter criteria, like it currently does, and then be able to somehow get the SQL statement it would send on to the DB, pass it on to the DB ourselves, and tell Crystal not to. the viewer would then supply the report with data.
Does anyone know if this can be done? An alternative we've considered is to have the viewer prompt the user for the filter criteria, and then build the SQL statement. However, then each report becomes a C# coding project with an update to the viewer. We're trying to avoid that.
Thanks.
Interesting approach. I have only ever done the opposite.
Normally people like to build their own reports using a Crystal client. The report connects to a datasource specified in the report itself.
Using .NET to query the reports needs, set parameters and formulas then view the report is a piece of cake.
Anyway, there are only two methods that I know of called "pull" and "push". Pull is what I just described above. Push is what you described as a solution that you considered but it would involve coding for each report.
I'm afraid what you are trying to do has never been done before. However, I would recommend the "pull" method. It has worked very well for me with a client with dozens of users and hundreds of reports.