This is a migrated thread and some comments may be shown as answers.

Using external assembly in reporting

8 Answers 669 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dario Concilio
Top achievements
Rank 2
Dario Concilio asked on 23 Jan 2017, 01:32 PM

Hi to all,

I have a solution with several projects: Client, Entities and Reports.

The last one doesn't see Entities assembly. Then I added Assembly reference, but this code it seems take not effect.... where I wrong?

<configuration>
  <configSections>
    <section name="Telerik.Reporting" type="Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting" allowLocation="true" allowDefinition="Everywhere" />
  </configSections>
   
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
 
  <Telerik.Reporting>
    <assemblyReferences>
      <add name="Brema.Entities" version="1.0.0.0" culture="neutral" publicKeyToken="null"/>
    </assemblyReferences>
  </Telerik.Reporting>
   
</configuration>

8 Answers, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 23 Jan 2017, 03:30 PM
Hi Dario,

Check if the AssemblyReferences element with the name of the required assembly is included in the configuration file of the application. In general, there are three possible scenarios where you might need to place the AssemblyReferences element:

  1. The Standalone Report Designer tool's configuration file, if you intend to use an ObjectDataSource component
  2. The configuration file of the project containing Telerik Reports
  3. The configuration file of the desktop application displaying/processing programmatically the report; or the configuration file of the Reporting REST|WCF Service project, this place is where reports are handled for web viewers
More detailed information about the required configurations is provided in the following articles:

If the issue persists please send us a demo project reproducing the problematic behavior in a support ticket.


Regards,
Katia
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Dario Concilio
Top achievements
Rank 2
answered on 23 Jan 2017, 03:39 PM

Hi Katia,

As you read from my post, I have already user yours document about "2.The configuration file of the project containing Telerik Reports", indeed, I wrote you because these instructions not has effect in my solution.

I would understand why....

0
Dario Concilio
Top achievements
Rank 2
answered on 23 Jan 2017, 03:47 PM

Ok, it's very strange, but....

I removed my ObjectDataSource and recreate again by wizard...

Now it works, it recreate app.config

0
Dario Concilio
Top achievements
Rank 2
answered on 23 Jan 2017, 04:06 PM
Errata corridge, it doesn't work....wizard corrects my app.config but it appers same error...
0
Accepted
Katia
Telerik team
answered on 23 Jan 2017, 04:47 PM
Hi Dario,

The attached screenshot shows the error when the report is displayed in WPF Report Viewer.

If the reports are residing in a separate project (ClassLibrary) make sure that AssemblyReferences element is also added to the configuration file of the WPF application.

Re-running the ObjectDataSource Wizard will only add the required changes in the current project's configuration file (ClassLibrary if reports are residing in a separate project).

If the viewer that displays the reports is a different project the changes need to be included in its configuration file as well.


Regards,
Katia
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Dario Concilio
Top achievements
Rank 2
answered on 24 Jan 2017, 07:59 AM

OK! I understand now!

It works! Thank you.

0
Dario Concilio
Top achievements
Rank 2
answered on 24 Jan 2017, 09:23 AM

Excuse me, but I need to understand another things.

I have External Resource assembly also.

So I have 4 projects:

  • MyApp.Client : WPF Application that it has reference with MyApp.Entities
  • MyApp.Enties: Business of Logic that connect with database
  • MyApp.Resources: Assembly that contains only bitmap file, setted with Compile Action = Resource
  • MyApp.Reports: Assembly that contains only report and it has reference with MyApp.Entities

In this assembly I defined several bitmap (png and bmp file) not as resources, but only changing Compile Action of all files. (see attach screenshot)

My report has reference for this assembly and (as for other assebly Myname.Entities.dll) I added Resources assembly in app.config (both project: main application and external project).

Property that I used with PictureBox (in my report) is an Uri

itemResult.Picture = new Uri("pack://application:,,,/Brema.Resources;component/BREMA.BMP");

NOTE: This code is executed in Entities assembly....

I supposed that it could sees resource assembly by same way that I used in XAML file (is it correct?)

But when I render my report it shows me this error (see attach screen shot)

 

0
Katia
Telerik team
answered on 24 Jan 2017, 12:26 PM
Hi Dario,

If you are receiving this error in report's Preview mode in Visual Studio, this is a known design-time limitation. The image should be displayed correctly though when you run the report in WPF Report Viewer.

If the error occurs in WPF Report Viewer as well verify that the path used to set the PictureBox's value can be resolved correctly at run-time - Pack URIs in WPF.


On the side note, our recommendation is to open a new topic for each unrelated question. This way other community members can find the topics they are interested in more easily.

Thank you for your understanding.


Regards,
Katia
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Dario Concilio
Top achievements
Rank 2
Answers by
Katia
Telerik team
Dario Concilio
Top achievements
Rank 2
Share this question
or