PDA

Click to See Complete Forum and Search --> : Crystal report without database con


super_nOOb
Mar 8th, 2007, 11:08 AM
Hey guys,

I was wondering if its possible to create a report without ever having to connect to a database. I mean, to use a set of variable strings from your program and then asign this values to the report.

Or if not in crystal where wlse could i do that?

Thx in advance :wave:

Hack
Mar 8th, 2007, 11:10 AM
Sure...it really doesn't matter where the data is coming from.

What, specifically, did you have in mind?

super_nOOb
Mar 8th, 2007, 11:51 AM
Really.........that is awesome!! I was using so far the SQL reporting tool, and aparently i could manage it only with database connections. Ill then buy the crystal report..............What i had in mind is to get the results from a query that i build (or the user, the result is displayed in a datagridview before he will print it), and then use the data of it to create a report.

Is that hard to do? Do you happen to have sample codes for it?
And last question, im using VB.NET 2005. Is crystal report compatible with it?

Thanks a lot for the reply Hack
:D

Hack
Mar 8th, 2007, 12:07 PM
First off, I rarely, if ever, use any of the built in fuctionality of a reporting tool when it comes to gather data. I always built a SQL SELECT query, and feed the resulting recordset to whatever I'm using to produce the report. I find it gives me more control over what the data is.

Crystal Reports is certainly available with VB.NET 2005....if you read through some of the questions in this section you will find a ton of people using 2005 and Crystal.

I'm not using Crystal as the moment. All of the reports that my apps are generating for my current customer use Excel as the report engine. This is kind of nice because I don't have to do anything in order to print them. I just gather what I need via an SQL query, dump the results to Excel, and then let Excel do all the rest of the work.

super_nOOb
Mar 8th, 2007, 03:04 PM
really?! That is a clever idea...........I actually tried something like that via word with the console.write but it was taking ages to complete my report. Your excel method seems to be very efficient and clever.
Probably will suit my needs much better than those reporting tools, which for me still seem to be too much "in the box" for me.

Do you manage to print the excel reports in pdf as well?
Would you mind giving me some tips on how could i try to implement this on my program?

I actually have been trying quite a few things as far as the reporting side of my project, because i didnt quite like the way the reporting tools work (where you have to place all the text in text boxes, and have the xml in behind code and also the connection to database issues i was having). I like much better the idea of creating reports based on arrays and strings that i can create inside of VB.NET and then manipulate them.
My 1st idea was that my program could "write" the report on word and then print in pdf. But this was as far as performance inefficient, it takes too long to write.
The second idea was to make my program write a xml file and then try to print the pdf from it. But i figured that id go crazy to try to write all the coding to create the xml files (which i still never did and i think its as slow as the msword idea)
The 3rd idea was to create the report from a rich text box that was placed inside of a form. But it still didnt look very good........
Im pretty much willing to give it a try to the excel idea. It might be the solution i was longing for.........
Thx for the replies and tips so far Hack :D

super_nOOb
Mar 9th, 2007, 04:01 AM
my idea in the end is to be able to make my reports without having to create data sources and data sets and without the need to use the localhost. To create the report, manipulate teh data, insert into the report, and create the preview and then the pdf inside of my vb.net

Hack
Mar 9th, 2007, 06:03 AM
I do not create PDF files, but, I'm told, that some of my customers will run the reports I've created, and create PDFs. That is there perogrative and what is so nice about Excel.

Once the spreadsheet is open with the required data, the user can do anything they individually want with it. All I do is give it to them. :)

super_nOOb
Mar 9th, 2007, 07:22 AM
Oh i see........
In my case i actually wanted to have the output of the report as a pdf, with the layout set and all. I actually have been trying dif things so far:
The code behind the reports(crystal and SQL reporting) is a xml. So i thought that in order to manage all the data inside my vb.net without the need to have a report server and to make a dataset for the reports i could do one of the following:
Either create a .doc file and then leave a few fields to be populated by .net (dont know if its possible) or to write the whole .xml file based on the reporting code. I actually tested a small application to write a .xml file and it seems to be fast. So after that i would probably need to use a xslt to transform the sml to xsl-fo to be able then to print to pdf ( i dont know how to do that too, but that is the info i got from my research)

And 3rd would be to learn how to use the SQL reporting server to manage reports there without need to have a dataset

Which one do you think it would be best for me??

EDIT:
Do you know how can i manage to print to pdf the xml. I actually found an old post where you posted a code, but i could not manage to make it work for me
here is the post:
http://vbforums.com/showthread.php?t=377453&highlight=xml+print

Hack
Mar 9th, 2007, 07:37 AM
To make PDF files we use CutePDF (http://www.cutepdf.com/)

What happened when you tried to print the XML file that didn't work?

super_nOOb
Mar 9th, 2007, 07:48 AM
I actually managed to print the xml by rightclick-print inside of my ie (explorer). But i actually got a pdf with the xml code. What i actually wanted was that the pdf could give me only the data inside of the xml in its fromated properties that are coded inside the xml. Here i have acrobat distiller and i usually print my pdf with Adobe PDF, but i have never wrote a code to do it in VB.net. Do i need to convert the xml using xslt to a xsl-fo to print to pdf? Every procedure i read in google tells me that i have to do that

EDIT

I just had an idea that might be a solution. Maybe i can create a xml file to store all the variable data of the report. Then instead of connectin the report data set the my database i connect it to the xml file (i have no clue how to do that yet) and then use the xml as the database for the report.
If this makes any sense can anyone tell me how to build a report based on a xml dataset please!!

super_nOOb
Mar 9th, 2007, 09:44 AM
I managed so far to create a xml(data.xml) file with the data i want to use in the report. Now i opened my report project in SQL Reporting 2005 and added the data.xml. I can manage to seethe xml code and the xml data inside of a data gird.
I now have no clue on how to "select * from xml". Does anyone have a clue on how to do that?

EDIT:

I could also try to use a template ms word document and then place the content inside of the xml in the varibale places (that can be a mail merge)

EDIT 2:

Ok i think i know what to do now. I have created a template ms word document that is referenced to a .txt file (with the mail merge feature). So basically what ill do is to update this txt file with the data i need in my report.
The issue now is the following: Can i run the new data in the ms word and print a pdf in a fast way. The best way would be not to show the whole process to the user. If that is a way to do this without ever having to open ms word it would be the best....

super_nOOb
Mar 16th, 2007, 05:21 AM
I didnt quite like the word final output.
Im thinking about writing a rtf file or a xml file and send them straight to the pdf printer.
Is it hard to do?
Has anyone ever tried that?