Hi everyone
The scenario is that I have designed letterheads and footers as subreports for our different clients.
Based on a SQL query I would like to load the correct letterhead/footer within any given main report.
I'm using C#.net and CR2008 as follows:
myReport.SubReports["letterhead"].Load(getClientLetterHead(clientCode));
where getClientLetterHead is a simple function that returns the file path of the sub report as a letterhead based on the client.
Problem is when I run the code I get an error as follows:
NotSupportedException was unhandled by user code : Not supported within subreports.
I evaluate myReport.SubReports["letterhead"] and the object is not null.
Does anyone have any ideas?
The alternative would be to create a main report per client, which would make maintainance a nightmare.
Also having the letterhead/footer database driven wouldn't work well as the letterheads are vastly different.
Your help is always appreciated.
Hi Create a parameter as a integer filed depends upon the client pass the parameter and suppress the sub reports which not required depend upon on the parameters and client
Example - client 1 - subreport1
Client2- subreort2
for client1 pass the parameter as 1 suppress the subreport2 and do voice-versa for client
Joined: 03 Feb 2009
Online Status: Offline
Posts: 8
Posted: 15 Jul 2011 at 3:12am
I was hoping that I wouldn't have to do it like this, especially given that we have 50+ clients.
If I understand you correctly I would need to add 50+ sub reports to the main report? Surely this would increase the size of the main report substantially? and is it even possible?
hi i hope this solution may useful for you. If you able to the save letterhead as a image call that image into the report using oledb object for each client you need to change the image. for all clients report will be same but images will be changing for each client and the image you need to save same path for all the clients
Joined: 03 Feb 2009
Online Status: Offline
Posts: 8
Posted: 20 Jul 2011 at 9:52pm
Thank you for your suggestion, definitely an alternative.
IMO still too much "working around" for a simple requirement.
What I have done in the mean time was combine all 50 clients letterheads into one report and hide their sections based on the client code, not the most elegant solution but again a work around.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum