-
July 5th, 2014, 07:59 AM
#1
[RESOLVED] How to add a Rdlc Report file to .Resx Resource file ?
I have a small project in VS2010.In that project I have one resource file called MyResources.resx. Now Iam using this MyResources.resx file to store the images required in my project. Also I have one report called REPORT1.rdlc. My Intention is to add that report file to that MyResources.resx resource file. Is it possible to access the report from that resouce file ?
From the below example, I stored Thatha.jpg image file in MyResources.resx. and accessed.
Code:
ResourceManager^ rm = gcnew ResourceManager("NewTest_EmbedRpt.MyResources", GetType()->Assembly);
pictureBox1->Image = safe_cast<Image^>(rm->GetObject("Thatha"));
Same way is it possible to store that Report1.rdlc in resources and can access?
Any codes and ideas will be very helpful.
Note: In c# BuidAction property is available to set the Report1.rdlc as EmbeddedResource.
Thanks for the guidances.
-
July 5th, 2014, 01:24 PM
#2
Re: How to add a Rdlc Report file to .Resx Resource file ?
This post demonstrates using a file resource: http://forums.codeguru.com/showthrea...39#post1994339. It's a cursor file (.cur) there, but as that isn't any specific managed resource type either, after all it's about handling general file resources.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
-
July 8th, 2014, 01:50 AM
#3
Re: How to add a Rdlc Report file to .Resx Resource file ?
Thanks Eri. You are my Visual C++ GURU. Thousands of thanks to you. Most of my Counter Variables are ERI ....only
Since I would like to remember with my lifetime to those kind helps & guidances....
As per your advise, the below code works like embedded report from resource, So that the enduser no need to keep the rdlc file in their program folder.
Codes
======
Code:
ResourceManager^ rm = gcnew ResourceManager("NewTest_EmbedRpt.MyResources", GetType()->Assembly);
MemoryStream ^MyRptStream = gcnew MemoryStream(static_cast<array<Byte> ^>(rm->GetObject("Report1")), false);
reportViewer1->LocalReport->LoadReportDefinition(MyRptStream);
Thanks again
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|