PDA

Click to See Complete Forum and Search --> : [RESOLVED] How to Embed CR instead of copying it


jre1229
Mar 15th, 2007, 10:36 AM
Hi,
Anyone know how to embed the CR instead of having to physically distribute it with the app?
I have this code which works fine but I want to get rid of the Reports folder.

cr.Load(strAppPath & "\Reports\SchDaysPerDept.rpt")

I tried changing the build action to embedded source and changed the path to just the report name but it didn't work either.
Thanks!

jre1229
Mar 15th, 2007, 11:25 AM
I found the solution!!!! Woo hoo!! I have been looking for this for so long. Turns out, I just needed to dim my variable as new "reportname" instead of ReportDocument!!

http://www.techsupport.businessobjects.com/infocenter/Dev/devlib/XI/EN/en/CrystalReports_dotNET_SDK/crystalreports_net_doc/doc/crsdk_net_doc/html/crtsktutorialsdatadsbindthereport.htm

I am so happy!!!

randem
Mar 17th, 2007, 04:15 PM
I don't get it... You still have to deploy the report for you app to work. It's not embedded...

jre1229
Mar 18th, 2007, 04:16 PM
I didn't... I completely removed my .rpt files from my deployment project and it still works.

randem
Mar 18th, 2007, 06:38 PM
Impossible unless you had already deployed the rpt files.

jre1229
Mar 19th, 2007, 11:52 AM
How can it be impossible. My reports were pointing to the startuppath/Reports folder which is where they resided. I went into my project and changed the reports to embedded and changed my declarations from reportDocument to the name of the report itself. I then went onto the network drive where the app is located, copied my new files over and made sure the Reports folder was gone, which it was. I can still view the reports. How can it be impossible when I am running this from a network drive which has 0 report files on it?

techgnome
Mar 19th, 2007, 12:34 PM
Because what was deleted was the deployed RPT files.... not the RPT files that are used for development. Two different sets of files.

-tg

jre1229
Mar 19th, 2007, 02:23 PM
Yes. I understand that. The whole object of this post was to get rid of the deployed .rpt files. Why would I want to get rid of my .rpt files in my development environment?

techgnome
Mar 19th, 2007, 02:26 PM
jre - that wasn't actually directed at you.... it was directed randem...

-tg

jre1229
Mar 19th, 2007, 02:27 PM
Ohhh. Sorry.

randem
Mar 20th, 2007, 03:11 AM
You asked how to embed them...

jre1229
Mar 20th, 2007, 07:04 AM
Yes and you said "I don't get it... You still have to deploy the report for you app to work. It's not embedded..." But I didn't deploy the reports. There are 0 report files in my deployment. Just forget about it, it works and that's all that matters to me.

randem
Mar 20th, 2007, 01:57 PM
The only way for it to work without the rpt file is if you use the data environment for CR and it has nothing to do with rpt files...

techgnome
Mar 20th, 2007, 02:46 PM
LEt me see if I can paint a clearer picture.... on the development side, the RPT files still exist. However, when deployed, they become EMBEDED into the resource file. Therefore, there are no physical (separate) RPT files on the client.

-tg

jre1229
Mar 21st, 2007, 07:20 AM
Exactly right techgnome!

vbmqmin
Apr 3rd, 2007, 05:09 AM
How can it be impossible. My reports were pointing to the startuppath/Reports folder which is where they resided. I went into my project and changed the reports to embedded and changed my declarations from reportDocument to the name of the report itself. I then went onto the network drive where the app is located, copied my new files over and made sure the Reports folder was gone, which it was. I can still view the reports. How can it be impossible when I am running this from a network drive which has 0 report files on it?

I don't undersend this.
Can you give me same code and step by step instruction? When and how you do steps?

Next question: It it posible to load raport from stream? Is sow this in one application where raports file was saved as binary in sql database.

techgnome
Apr 3rd, 2007, 11:42 AM
Stream? Probably not... but what you can do is using BLOB, retrieve the binary data from SQL, send the data to a physical file (we use the temp dir and a temp file name) and save it. From there you can Report.Load path-to-rpt-file to open it.

-tg

edit: this link should be helpful in learning how to read a BLOB.
http://support.microsoft.com/default.aspx?scid=kb;en-us;308042