Success!
I have been a battle all week. No… make that an all out war.
All I wanted to do was for my users to be able to generate a pdf report off my web site. Sounds simple, doesn’t it.
The previous programmer that worked here had the data for our crystal reports go into a SQL table using vb.net. It worked fine as long as only one user access the report. But when two or more accessed it at the same time, data got crossed over.
So in my wisdom, I thought simply replacing the table with a dataset would solve the problem. Then I found out that Crystal Reports has to see a dataset like a real table, so I added a dataset (xsd file) to my .net project window. I had my vb.net dataset data going to this xsd file and pointed crystal reports to it.
My original web page redirected the user to another aspx page with the cystalreportviewer on it. This worked fine, when using a real database table, but I found it didn’t work with the dataset. I needed the crystalreportviewer to be populated before I closed my dataset. (The dataset is just a virtual table that only exist while it is being used)
So I moved the crystalreportviewer to my original web page. It opened up fine there, except my users could not save or print the report without all the other garbage on the page. I could hid all those objects when the report came up, but there was still the crystal reports toolbar. I could hid that, but the user would loose the browse by page and the search feature. They would be at mercy of whatever their web browser had.
What I need was to convert the report to a pdf file. Here is where the real fun started. I’ll spare you my battle wounds and get to the victory. I had to save the data as a pdf file to my web server, giving it a unique name and then bouncing it back to the user. (I had tried to use a memory stream from the System.IO, which worked on my developer box, but the web server refused to take it).
So SOB! It Works!
Converting Crystal Reports to a pdf file on a web server.
