Quantcast
Channel: Visual Studio Report Controls Forum
Viewing all 519 articles
Browse latest View live

"Failed to load expression host assembly" when rendering local report

$
0
0

I am getting the error "Failed to load expression host assembly" when rendering a local report using report viewer.

My report is in a folder called Reports, which exists in a class library. I call the following with report viewer:

reportViewer.LocalReport.ReportEmbeddedResource = "namespace.project.Reports.myReport.rdlc";

This appears to be the correct reference, as if I change it to something that doesn't exist I receive the following error: "{"The report definition for report 'blah' has not been specified"}

I have searched a few forums and websites and some people have encountered the same error, and solved it by using:

            System.Security.PermissionSet permissions = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
            reportViewer.LocalReport.SetBasePermissionsForSandboxAppDomain(permissions);

However this hasn't worked for me.

Any help would be greatly appreciated.


Visual Studio 2010 Reporting Services Data retrieval failed for the subreport

$
0
0

After finding several examples of code, I've come up with the following code. However, I am getting "Data retrieval failed for the subreport" error on my .aspx page. The main report and subreport works fine in BIDS 2008, so it has to be something wrong my .cs or .aspx pages.

Can anyone tell me what I'm doing wrong?

Thanks!

Here's the .aspx code:

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="SummeryReportOutBrief.aspx.cs" Inherits="Secured_Reports_SummeryReportOutBriefAll" %><%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %><asp:Content ID="Main" ContentPlaceHolderID="ContentPlaceHolderMain" Runat="Server"><asp:DropDownList ID="DropDownListVisit" runat="server" DataTextField="VisitList"
        DataValueField="VisitID" AutoPostBack="True"  AppendDataBoundItems="true"
        onselectedindexchanged="DropDownListVisit_SelectedIndexChanged"
        DataSourceID="EntityDataSourceVisitDropDown"><asp:ListItem Text="--- Select Ship & Visit ---" Value="" Selected="True"></asp:ListItem></asp:DropDownList><asp:EntityDataSource ID="EntityDataSourceVisitDropDown" runat="server"
        ConnectionString="name=Admiral_NSSAEntities"
        DefaultContainerName="Admiral_NSSAEntities" EnableFlattening="False"
        EntitySetName="vw_VisitList"
        Select="it.[VisitID], it.[VisitList], it.[ShipName], it.[StartDate]"
        OrderBy="it.[ShipName] asc, it.[StartDate] desc"></asp:EntityDataSource><rsweb:ReportViewer ID="ReportViewerSummeryReportOutBrief" runat="server" Font-Names="Verdana"
        Font-Size="8pt" InteractiveDeviceInfos="(Collection)"
        WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="1139px"
        Height="894px" PageCountMode="Actual" PromptAreaCollapsed="True"
        style="margin-right: 0px"><LocalReport ReportPath="Secured\Reports\SummeryReportOutBrief.rdlc"><DataSources><rsweb:ReportDataSource DataSourceId="EntityDataSourceVisitInfo"
                    Name="VisitInfo" /><rsweb:ReportDataSource DataSourceId="EntityDataSourceWorkOrders"
                    Name="WorkOrders" /><rsweb:ReportDataSource DataSourceId="EntityDataSourcePartsDataByWorkOrder"
                    Name="PartsDataByWorkOrder" /></DataSources></LocalReport></rsweb:ReportViewer><asp:EntityDataSource ID="EntityDataSourcePartsDataByWorkOrder" runat="server"
        ConnectionString="name=Admiral_NSSAEntities"
        DefaultContainerName="Admiral_NSSAEntities" EnableFlattening="False"
        EntitySetName="vw_PartsDataByWorkOrder" ></asp:EntityDataSource><asp:EntityDataSource ID="EntityDataSourceWorkOrders" runat="server"
        AutoGenerateOrderByClause="True" AutoGenerateWhereClause="True"
        ConnectionString="name=Admiral_NSSAEntities"
        DefaultContainerName="Admiral_NSSAEntities" EnableFlattening="False"
        EntitySetName="vw_WorkOrders" Where=""><WhereParameters><asp:ControlParameter ControlID="DropDownListVisit" DbType="Guid"
                Name="VisitID" PropertyName="SelectedValue" /></WhereParameters></asp:EntityDataSource><asp:EntityDataSource ID="EntityDataSourceVisitInfo" runat="server"
        AutoGenerateOrderByClause="True" AutoGenerateWhereClause="True"
        ConnectionString="name=Admiral_NSSAEntities"
        DefaultContainerName="Admiral_NSSAEntities" EnableFlattening="False"
        EntitySetName="vw_VisitInfo" Where=""><WhereParameters><asp:ControlParameter ControlID="DropDownListVisit" DbType="Guid"
                Name="VisitID" PropertyName="SelectedValue" /></WhereParameters></asp:EntityDataSource></asp:Content>

In the code behind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Reporting.WebForms;
using System.Configuration;

public partial class Secured_Reports_SummeryReportOutBriefAll : System.Web.UI.Page
{    
    protected void Page_Load(object sender, EventArgs e)
    {               
        if (DropDownListVisit.SelectedValue == "")
        {
            this.ReportViewerSummeryReportOutBrief.Visible = false;

            ReportViewerSummeryReportOutBrief.LocalReport.Refresh();             
            ReportViewerSummeryReportOutBrief.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SubreportProcessingEventHandler);               
        }
    }

    public void SubreportProcessingEventHandler(object sender, SubreportProcessingEventArgs e)
    {
        
        e.DataSources.Add(new ReportDataSource("PartsDataByWorkOrder", this.EntityDataSourcePartsDataByWorkOrder));
    }

    protected void DropDownListVisit_SelectedIndexChanged(object sender, EventArgs e)
    {
        //In App_Code _TemplateFiles
        Reports.ShowReport(this.DropDownListVisit, this.ReportViewerSummeryReportOutBrief);
    }
}


~Sonny

ReportViewer Parameters Display

$
0
0

Hi

I am creating localreports using VS 2010 in C#. I have a reportviewer control and an .rdlc embedded into it in a windows client application. I am passing parameters to the report via a combo control. How do I get to display the parameter values in a textbox in the report page. I have used SSRS previously and it is pretty straight forward in BIDS.

Thanks in advance.

Hanu

Metafile not disposing correctly?

$
0
0

Very strange issue here and I'm stumped.

To start, I'm taking a LocalReport and rendering with a slightly modified version of this:This

Once I have the rendered pages, I provide the streams to a PrintDocument. It has a PrintPage handler that creates a Metafile with the page stream and draws the metafile content onto the PrintPageEventArgs Graphics.

Here's the PrintPage:

if (stream.Length > 0)
{
    stream.Position = 0;
    using (var pageImage = new Metafile(stream))
    {
        ev.Graphics.DrawImage(pageImage, ev.PageBounds);
    }

    stream.Close();
    stream.Dispose();
    GC.Collect();
}


I was having a problem with getting a generic GDI exception, but it only seemed to be if I was printing a large enough report and if it was being printed from a Windows XP machine.

My thought was that the metafile wasn't getting disposed properly. What I decided to do was put the following in a loop:

for ( loop = 0; loop < 100; loop++)
{    
    stream.Position = 0;
    using (var pageImage = new Metafile(stream))
    {    
        ev.Graphics.DrawImage(pageImage, ev.PageBounds);
    }
}

Here are my observations:

1. Windows XP: Same problem as before, generic GDI crash. Also note that I tested this with a small version of the report that normally would have rendered fine.

2. Windows 7: Doesn't crash, but renders strange. The report has a photo in the middle of the first page. It seems to have taken this photo and shrunk it down to about half the size and layered it on top of the correct sized photo. It seemed like the rest of the report rendered fine.

I'm not really worried about the Windows 7 issue since it renders fine normally. I'm just wondering what I'm supposed to do about the Windows XP problem. Upgrading the XP machine to 7 is an option, but I was hoping to actually fix the issue. My gut feeling says it's an issue with not disposing properly, but I don't know what to do.

I thought it was related to This, but we seem to have the latest copy of the file.


Gerar Layout Dinamicamente

$
0
0

Olá a todos!

O que eu gostaria é gerar o layout do relatório dinamicamente, pois só saberei quantos gráficos, por exemplo, serão criados, em tempo de execução.

É possível fazer isso usando o ReportViewer ou Crystal Report?

Obrigada!

crystal report 13 don't work in my PC, why?

$
0
0

i have a database "Shop.MDF"

Shop->

       +table ->

                 +Goods->

                             ID

                             Name

                             Group

created report with reportviewer and any tinghs is ok. show all data in filds

but when created report with crystal report 13 all fild heder show but all of data in name fild is colour name and other data is difrent data.

why?

please help me.

How to create custom report using MS Access and Report Viewer

$
0
0
Guys, do you have codes, guides or tutorials that will help me to create custom reports using report viewer, I mean the data queried to the database will show in the report viewer. I don't have any idea using this, this is just my first time to use this. Thank You Guys. 

Object datasources vanish from rdlc data sources in web project


Local Report.Render to PDF taking a long time

The report definition for report 'report.rdlc' has not been specified

Microsoft Report Problem

$
0
0

Hello

I have created a report with Visual Studio 2012 Premium.
On my computer works fine but on the other computer I got the message from the image bellow and I really cannot solve the problem.

I have copied on a client machine the following .dll's:

 


Thanks in advance, Ciprian LUPU

how to use pie chat in report c#

$
0
0

 i create report and dataset

 then create pie chat but i can not change the slice

Visual Studio 2012 crashed while adding data source to report viewer

$
0
0

I am trying to create rdlc report in vs 2012 ultimate. report was working fine on vs 2010. Now problem is: Visual studio crashed (closed) when I try to add data source in report viewer. 

any suggestion to resolve this issue. Is this a known error in vs 2012 ultimate ?

How can I create reports (.rdlc) in VS 2012 for Web (Free version)

$
0
0

Hello. I have used MS Web Deveoper 2008 Express so far for creating reports (.rdlc). Now I would like to use VS 2012 for Web. I have created a new project but I can not add Reports to solution because there are none in the installed templates panel. Basicly I am trying to do exacly as described in there - http://msdn.microsoft.com/en-us/library/ms252067.aspx

Please advice...

[VB 2010] ReportViewer wrapping the details in the selection set.

$
0
0

I apologize formy bad English
 

Good day to all

I created aquerywhich results inthevendors sellingbread, pasta andflourand buyerswho boughtthe same products.

Iseeeverythingin ReportViewerit worksbut it iswell done, that is,

seller

Kg of bread

Kgof dough

Kg of flour

Giovanni

30

20

15

buyer

Kgof bread

Kgof dough

Kg of flour

Tizio

4

3

2

I would like tobringunderthe captionbuyerandsellerto indentthe same products,highlighting themwithcolor anddifferent fonts.

seller

Kg of bread

Kgof dough

Kg of flour

 

Giovanotto

30

20

15

Tizio

4

3

2

AsIdidI could notnor have I found somethingon the Internet.
You can? Ifitisimpossible to know how?
thanks
Celestino


The report definition for report 'ABC.rdlc' has not been specified

$
0
0

Hi all,

I've recently moved my RDLC files into the class library (as I'm going to be having multiple "UI" projects accessing the same reports). So as I moved them to the class library and set them as Embedded Resources I changed the binding of the report viewer to:

Microsoft.Reporting.WebForms.ReportDataSource rdsAPI = new Microsoft.Reporting.WebForms.ReportDataSource("DS1", ds1 as System.Data.DataTable);
Microsoft.Reporting.WebForms.ReportDataSource rdsUser = new Microsoft.Reporting.WebForms.ReportDataSource("UserDS", user as System.Data.DataTable);

ReportHelper.SetReportEmbeddedResource(rvds1Pdf, "ClassLibrary1.Namespace.Blah.ds1.rdlc");
rvds1Pdf.LocalReport.DataSources.Add(rdsds1);
rvds1Pdf.LocalReport.DataSources.Add(rdsUser);
rvds1Pdf.Visible = true;
byte[] reportData = rvds1Pdf.LocalReport.Render("PDF");
rvds1Pdf.Visible = false;

The ReportHelper.SetReportEmbeddedResource method is inside the same class library as the RDLC because that's the only way I've found it to work and all it does is this:

public static void SetReportEmbeddedResource(Microsoft.Reporting.WebForms.ReportViewer reportViewer, string reportName)
{
            reportViewer.LocalReport.ReportEmbeddedResource = reportName;
}

All works perfectly until I deploy it to the UAT box. Then I receive "The report definition for report 'ClassLibrary1.Namespace.Blah.ds1.rdlc' has not been specified"!

I used http://www.codeproject.com/Articles/3262/A-NET-assembly-viewer to double check that the RDLC is present as a Manifest Resource inside the DLL that's on the UAT box, which it is. So I'm a bit stumped why this is happening. I'm using a box standard web deployment project package the web site.

Any thoughts/suggestions?

Kind regards

Sidharth

Open report in Excel from winforms reportviewer control

$
0
0

When opening a report  from Internet Explorer, you have the option to open, but I do not see this as available from the winforms reportviewer control.  Is there a way to enable it?

Thanks


Thanks,
Corey Furman @ Facebook
______________________________________________________
Please mark posts as answer or helpful when they are.

Master Detail Report using Microsoft Reporting Technology-C#, winforms, datafrom dataset having datarelation

$
0
0

Hi,

I am using xml file to load the dataset with data. I want Master Detail Report from that dataset. In my dataset , I have datarelation for my child reports.

1. I wanted to know how to generate the Master Detail Report from XMl and for child report I want to use data relations in the dataset. If this is possible in Microsoft Reporting Technology , could you please send me the sample code.

2. In layout window can I drag and drop the column (in above case) at degin time and load data at run time.

3. How can I allow the end user to generate there own customized report just by drag and drop field from the filed list.

Thanks in advance,

Master Detail Report using Microsoft Reporting Technology-C#, winforms, datafrom dataset having datarelation

$
0
0

I am using xml file to load the dataset with data. I want Master Detail Report from that dataset. In my dataset , I have datarelation for my child reports.

Please know me, how to generate the Master Detail Report from XMl and for child reports using data relations in the dataset (created from xml). If this is possible in Microsoft Reporting Technology , could you please send me the sample code.

I tried this: In the "Report Name" property of subreport control of master report, there is no report showing in drop down list to select. So I wrote table name without extension. But now I need to set the parameter (master.id=client.oid) but I am not showing any parameter in "Name" list.

Custom assembly in Report Viewer with .Net Framework 4

$
0
0

Hello all,

I've developed an application on .net Framework 3.5 and I'm currently migrating it on .net Framework 4.

I'm facing a problem with security policies related to ReportViewer.

In my application, I'm using a specific .dll to format numbers and this .dll is called by several local reports (.rdlc files). In order for the project to compile, I dutifully copy the .dll in the Common 7\IDE\Private Assemblies directory.

I also included these two lines of code (which I found on the blog of a development genius, but I don't really understand them) in the form that contains the ReportViewer:

myReportViewer.LocalReport.ExecuteReportInCurrentAppDomain(Reflection.Assembly.GetExecutingAssembly().Evidence) 

myReportViewer.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("A3I.Adonat.Métier, Version=8.3.0.0, Culture=neutral, PublicKeyToken=null") 

Now these lines of code don't run...

What should I do ? Is there another way of using a custom .dll in a local report ? I've followed the Microsoft documentation and placed the following line in my App.config :

<runtime><NetFx40_LegacySecurityPolicy enabled="true"/></runtime>

but it still doesn't work...

 

Please help!!

Viewing all 519 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>