473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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.

Oct 10 '08 #1
5 6619
Srinidhi wrote:
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.
Oct 11 '08 #2
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" <jm******@xs4all.nlwrote in message
news:48*********************@news.xs4all.nl...
Srinidhi wrote:
>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.

Oct 11 '08 #3
Srinidhi wrote:
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.
Oct 11 '08 #4
'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" <jm******@xs4all.nlwrote in message
news:48*********************@news.xs4all.nl...
Srinidhi wrote:
>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.ReportEmbeddedResourc e = "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=***\***.rdl c
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.

Oct 11 '08 #5
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" <Do******@NoMail.comwrote in message
news:%2******************@TK2MSFTNGP04.phx.gbl...
'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" <jm******@xs4all.nlwrote in message
news:48*********************@news.xs4all.nl...
>Srinidhi wrote:
>>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.ReportEmbeddedResour ce = "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=***\***.rd lc
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.


Oct 12 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: MikeY | last post by:
With Reference/Resource is there a way of embedding the .resource file within a folder of my application instead of having it in the main project /executing assembly area. i.e. if I have a folder...
1
by: Namratha Shah \(Nasha\) | last post by:
Hi All, This is a resource file generation tool which converts an xml based resource formats to .net resource file i.e. (.resources) and vice-versa. Today we will see how we will generate ...
2
by: Matt | last post by:
I'm working on a plug-in for an application called DesktopSideBar for Windows. It emulates to some degree the Longhorn sidebar. The SDK for DesktopSideBar supports .NET plug-in development through...
2
by: Chris Murphy via DotNetMonster.com | last post by:
Hi all, I've been strugling with this for the last few days and I'm wonding if any of you have had the same problem or a solution I could consider: I'm embedding a bitmap resource (PNG format) as...
1
by: coz | last post by:
Someone please help! I cannot for the life of me get a web resource in asp.net 2.0 to return any content. I know I have correctly embedded my resources (because I can manually get the resources...
11
by: Dave Brown | last post by:
Hi there. Does anyone know if it's possible to embed a new resource into an assembly at runtime as well as update an existing (assembly) resource. Any assistance would be appreciated. Thanks.
1
by: Jon Paal | last post by:
trying to embed a text file as a resource when compiling with vbc.exe /resource: "readme.txt" error returned is asking for <resinfo> what is "<resinfo" and what is correct command line...
10
by: Alain R. | last post by:
Hi, I have some problem to retrieve an image from my application. Here is my code : Stream imgStream = null; Assembly a = Assembly.GetExecutingAssembly(); imgStream =...
0
by: VigneshS | last post by:
Hi, I am a newbie to Globalization and Localisation Concepts. I tried almost all the methods of the Globalization concepts. But i cannot be able to embed a text file within a Resource. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.