Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Resource embedding problem

Reply
 
Old 10-10-2008   #1 (permalink)
Srinidhi


 
 

Resource embedding problem

I'm trying to embed a report (.rdlc) file in my project. But it always stays
as linked. The 'Persistance' property is grayed & always set to 'Linked at
compile time'.
Upon further inspection i saw that only graphic files, icons & wave files
were able to be embeded. How can i embed other file types? Especially my
report files.




My System SpecsSystem Spec
Old 10-11-2008   #2 (permalink)
Jeroen Mostert


 
 

Re: Resource embedding problem

Srinidhi wrote:
Quote:

> I'm trying to embed a report (.rdlc) file in my project. But it always stays
> as linked. The 'Persistance' property is grayed & always set to 'Linked at
> compile time'.
> Upon further inspection i saw that only graphic files, icons & wave files
> were able to be embeded. How can i embed other file types? Especially my
> report files.
>
The terminology is confusing. "Linked" here doesn't mean "remains as a
separate file" but "is linked together with the .EXE". A "linked" file is
still embedded in your .EXE, it just isn't embedded in the .RESX file. This
should make no functional difference.

If you really want to stuff it in the .RESX for some reason, you can, but
only clumsily: convert the file to a Base64-encoded string and store it as a
string resource. This has storage overhead and also complicates using the
resource.

--
J.
My System SpecsSystem Spec
Old 10-11-2008   #3 (permalink)
Srinidhi


 
 

Re: Resource embedding problem

Hello,
You're right. The resources are actually embeded in the exe. I checked it
inside the exe.
Thanks a lot for telling me. I'd have never known otherwise.
But i wonder why i cannot specify the embeded report name and get the
report.

If i use this code for Eg:
ReportViewer1.LocalReport.ReportEmbeddedResource = "EmbReport1";

This error pops up in the report control
"An error occured during local report processing. The report definition for
report
'EmbReport1' has not been specified"

I have no problem getting the report with this instead
ReportViewer1.LocalReport..ReportPath=***\***.rdlc

"Jeroen Mostert" <jmostert@xxxxxx> wrote in message
news:48f07880$0$185$e4fe514c@xxxxxx
Quote:

> Srinidhi wrote:
Quote:

>> I'm trying to embed a report (.rdlc) file in my project. But it always
>> stays
>> as linked. The 'Persistance' property is grayed & always set to 'Linked
>> at
>> compile time'.
>> Upon further inspection i saw that only graphic files, icons & wave files
>> were able to be embeded. How can i embed other file types? Especially my
>> report files.
>>
> The terminology is confusing. "Linked" here doesn't mean "remains as a
> separate file" but "is linked together with the .EXE". A "linked" file is
> still embedded in your .EXE, it just isn't embedded in the .RESX file.
> This should make no functional difference.
>
> If you really want to stuff it in the .RESX for some reason, you can, but
> only clumsily: convert the file to a Base64-encoded string and store it as
> a string resource. This has storage overhead and also complicates using
> the resource.
>
> --
> J.

My System SpecsSystem Spec
Old 10-11-2008   #4 (permalink)
Jeroen Mostert


 
 

Re: Resource embedding problem

Srinidhi wrote:
Quote:

> Hello,
> You're right. The resources are actually embeded in the exe. I checked it
> inside the exe.
> Thanks a lot for telling me. I'd have never known otherwise.
> But i wonder why i cannot specify the embeded report name and get the
> report.
>
> If i use this code for Eg:
> ReportViewer1.LocalReport.ReportEmbeddedResource = "EmbReport1";
>
> This error pops up in the report control
> "An error occured during local report processing. The report definition for
> report
> 'EmbReport1' has not been specified"
>
> I have no problem getting the report with this instead
> ReportViewer1.LocalReport..ReportPath=***\***.rdlc
>
I don't know anything about whatever type "ReportViewer1" is, so I can't
really help you there.

If I had to guess, though: try specifying the actual, full name of the
resource. This will usually be "<default namespace>.<full name of the
file>". So it'll probably be "MyApplication.Resources.EmbReport1.rdlc" or
something along those lines. You can get the resource names with
Assembly.GetManifestResourceNames().

--
J.
My System SpecsSystem Spec
Old 10-11-2008   #5 (permalink)
Srinidhi


 
 

Re: Resource embedding problem

'ReportViewer1' is just the report viewer control name i've used
I've tried everything possible but i'm still not getting it. I'm at the end
of my wits. I guess i'll give it a break and try again tomorrow
Thanks a lot for your help

"Jeroen Mostert" <jmostert@xxxxxx> wrote in message
news:48f11ced$0$193$e4fe514c@xxxxxx
Quote:

> Srinidhi wrote:
Quote:

>> Hello,
>> You're right. The resources are actually embeded in the exe. I checked it
>> inside the exe.
>> Thanks a lot for telling me. I'd have never known otherwise.
>> But i wonder why i cannot specify the embeded report name and get the
>> report.
>>
>> If i use this code for Eg:
>> ReportViewer1.LocalReport.ReportEmbeddedResource = "EmbReport1";
>>
>> This error pops up in the report control
>> "An error occured during local report processing. The report definition
>> for report
>> 'EmbReport1' has not been specified"
>>
>> I have no problem getting the report with this instead
>> ReportViewer1.LocalReport..ReportPath=***\***.rdlc
>>
> I don't know anything about whatever type "ReportViewer1" is, so I can't
> really help you there.
>
> If I had to guess, though: try specifying the actual, full name of the
> resource. This will usually be "<default namespace>.<full name of the
> file>". So it'll probably be "MyApplication.Resources.EmbReport1.rdlc" or
> something along those lines. You can get the resource names with
> Assembly.GetManifestResourceNames().
>
> --
> J.

My System SpecsSystem Spec
Old 10-12-2008   #6 (permalink)
Srinidhi


 
 

Re: Resource embedding problem

I Finally Got It!
I just had to write it like this.
reportViewer1.LocalReport.ReportEmbeddedResource = "MyApp.Report1.rdlc";
where
reportViewer1 > is the report viewer control's name
MyApp > is the proj name
Report1.rdlc > name of the resource file.
Although i had set the name of the resource entry to 'EmbReport1', i had to
actually give the name of the file (Report1.rdlc)
Thanks for all the help

"Srinidhi" <DontSend@xxxxxx> wrote in message
news:%23ryMX8%23KJHA.1012@xxxxxx
Quote:

> 'ReportViewer1' is just the report viewer control name i've used
> I've tried everything possible but i'm still not getting it. I'm at the
> end of my wits. I guess i'll give it a break and try again tomorrow
> Thanks a lot for your help
>
> "Jeroen Mostert" <jmostert@xxxxxx> wrote in message
> news:48f11ced$0$193$e4fe514c@xxxxxx
Quote:

>> Srinidhi wrote:
Quote:

>>> Hello,
>>> You're right. The resources are actually embeded in the exe. I checked
>>> it inside the exe.
>>> Thanks a lot for telling me. I'd have never known otherwise.
>>> But i wonder why i cannot specify the embeded report name and get the
>>> report.
>>>
>>> If i use this code for Eg:
>>> ReportViewer1.LocalReport.ReportEmbeddedResource = "EmbReport1";
>>>
>>> This error pops up in the report control
>>> "An error occured during local report processing. The report definition
>>> for report
>>> 'EmbReport1' has not been specified"
>>>
>>> I have no problem getting the report with this instead
>>> ReportViewer1.LocalReport..ReportPath=***\***.rdlc
>>>
>> I don't know anything about whatever type "ReportViewer1" is, so I can't
>> really help you there.
>>
>> If I had to guess, though: try specifying the actual, full name of the
>> resource. This will usually be "<default namespace>.<full name of the
>> file>". So it'll probably be "MyApplication.Resources.EmbReport1.rdlc" or
>> something along those lines. You can get the resource names with
>> Assembly.GetManifestResourceNames().
>>
>> --
>> J.
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Embedding Vista mail
Embedding Music Vista mail
Trouble embedding a manifest into a .exe Vista security
Embedding an .exe in a gadget? Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46