ReportViewer Problem - Why the report does not change

Hi,

I am using the followig code in an ajaxenabled we site to I am trying to show different reports using the same reportviewer. The problem is that after page load,  if I click on linkbuton2 report 2 shows up. if I click on report 1, again report 2 shows up. If I reload the page and click on linkbutton 1 first I get the error

  • A data source instance has not been supplied for the data source 'DataSet2_MFG_Offers'.

I have commented reportviewer1.databind() because it causes an error

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 41:         reportViewer1.LocalReport.DataSources.Add(new ReportDataSource(ReportDataset, LoadReportData(spTarget)));
Line 42:         reportViewer1.Width = System.Web.UI.WebControls.Unit.Percentage(100.00);
Line 43:         reportViewer1.DataBind();

 

 

Does anybody have any ideas? Here is the code I am using:

protected void LinkButton1_Click(object sender, EventArgs e)

{

SetReport("Report1.rdlc", "DataSet1_MFG_Brand","Select * from mfg_offers" );

this.programmaticModalPopup.Show();

}

protected void LinkButton2_Click(object sender, EventArgs e)

{

SetReport(
"Report2.rdlc", "DataSet2_MFG_Offers","Select * from mfg_Brand" );this.programmaticModalPopup.Show();

}

public void SetReport(string ReportFile, string ReportDataset, string spTarget)

{

ReportViewer reportViewer1 = new ReportViewer();

reportViewer1.ProcessingMode = ProcessingMode.Local;

reportViewer1.LocalReport.ReportPath = Server.MapPath(@"\Reports\"+ReportFile);

reportViewer1.LocalReport.DataSources.Add(new ReportDataSource(ReportDataset, LoadReportData(spTarget)));

reportViewer1.Width = System.Web.UI.WebControls.Unit.Percentage(100.00);

//reportViewer1.DataBind();

PlaceHolder1.Controls.Remove(reportViewer1);

PlaceHolder1.Controls.Add(reportViewer1);

 

}

private DataTable LoadReportData(string spTarget)

{

DataSet dataSet = new DataSet();

dataSet = CM.RunQuery(spTarget);

//dataSet.ReadXml(Server.MapPath("../"+FileName));

return dataSet.Tables[0];

}

 

 

 

1
mhariri
8/11/2007 4:05:28 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

8 Replies
1465 Views

Similar Articles

[PageSpeed] 54

Yeah....if I can remember correctly, I think it has something to do with the DataSetName inside of the .rdlc file itself.

Did you copy and paste and then make changes to one of your .rdlc's?

Try this, name the datasets the same and see what happens for both LinkButton1 and LinkButton2...

protected void LinkButton1_Click(object sender, EventArgs e) 
{
     SetReport("Report1.rdlc", "SAMEDATASETNAME","Select * from mfg_offers" );
     this.programmaticModalPopup.Show(); 
}

protected void LinkButton2_Click(object sender, EventArgs e) 
{
     SetReport("Report2.rdlc", "SAMEDATASETNAME","Select * from mfg_Brand" );
     this.programmaticModalPopup.Show(); 
}

If that doesn't work, then open up your reports and check to see that the DataSetNames are the same.

 

Hope this helps,

Jason Conway

 


Jason Conway

MCP, MCTS, Certified SCRUM Master

asp.net blog
0
nicequy
8/11/2007 5:47:09 AM

Hi,

Thank you or the post. when I changed the datasetname to the linkbutton 1 datasetname there are no errors but the same report show up. If I change it to report2 data set I get the error

  • A data source instance has not been supplied for the data source 'DataSet1_MFG_Brand'.

 

I think I created two new reports. The symptom is that if report 1 is selected first both linkbutton show report 1. If button 2 is selected, then both linkbuttons show report2 do I have to clear something on the client side?? Let me know if you have any other suggestions.

Thank you

  • A data source instance has not been supplied for the data source 'DataSet1_MFG_Brand'. 
0
mhariri
8/11/2007 11:15:54 AM

Here is another clue, If I set a parameter and call the page again, the correct report show up. There is no data in the report but the static part of report is showing fine. somehow the control is cached on the client browser and is not refershed it seems like. I am still trying to figure out why no data show up in the report! here is my page load for this example

protected void Page_Load(object sender, EventArgs e)

{

switch(Request.QueryString["I"])

{

case "1": SetReport("Report1.rdlc", "DataSet1_MFG_Brand", "Select * from mfg_offers"); break;

case "2": SetReport("Report2.rdlc", "DataSet2_MFG_Offers", "Select * from mfg_Brand"); break;

{

}

}

}

protected void OpenOrders_Click(object sender, EventArgs e)

{

 

//ObjectDataSource1.SelectParameters[0].DefaultValue = Request.ServerVariables["HTTP_HOST"].ToLower();

}

protected void LinkButton1_Click(object sender, EventArgs e)

{

Response.Redirect(
"default2.aspx?I=1");

//SetReport("Report1.rdlc", "DataSet1_MFG_Brand", "Select * from mfg_offers");

 

}

 

-1
mhariri
8/11/2007 6:05:53 PM

Okay, I apologize I was thinking of something else.  The DataSetName has to be the same in the .rdlc itself.  So "DataSet1_MFG_Brand" has to be the DataSetName on your report's table.  Is this how you have it?

In my solution, in order to get it to work, I had to add a ReportViewer to the markup and then instantiate a new one, adding it to the Controls collection...I don't think I was able to use the same one like you are doing.

1    Microsoft.Reporting.WebForms.ReportViewer newViewer = new Microsoft.Reporting.WebForms.ReportViewer();
2    
3    newViewer.ID = "ReportGenerator";
4    newViewer.Visible = true;
5    newViewer.BackColor = Color.Transparent;
6    newViewer.LinkActiveColor = Color.DarkBlue;
7    newViewer.LinkActiveHoverColor = Color.DarkBlue;
8    newViewer.ShowFindControls = false;
9    newViewer.ShowPromptAreaButton = false;
10   newViewer.ShowRefreshButton = false;
11   newViewer.ShowZoomControl = false;
12   newViewer.AsyncRendering = false;
13   newViewer.SizeToReportContent = true;
14   newViewer.ShowPageNavigationControls = false;
15   newViewer.ShowExportControls = true;
16   newViewer.ShowParameterPrompts = false;
17   
18   newViewer.LocalReport.DataSources.Add(source);
19   newViewer.LocalReport.ReportPath = Server.MapPath(setting.ReportPath);
20   newViewer.LocalReport.DisplayName = setting.DisplayName;
21   
22   this.ReportContent.Controls.Remove(this.ReportGenerator);  //this is here because something needs to be removed in order for the ReportViewer to "reset"
23   this.ReportContent.Controls.Add(newViewer);

 Does this make sense?

Jason Conway

 


Jason Conway

MCP, MCTS, Certified SCRUM Master

asp.net blog
0
nicequy
8/11/2007 10:37:06 PM

No, I am still confused. I was able to rebuild the reports and I have a demo page that displays the correct report with the data as long as I do a response.redirect. If I do a postback I have the same problem only one old report keeps showing up. There must be something with page load. Here is the code

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using Microsoft.Reporting.WebForms;

public partial class Admin_Default2 : System.Web.UI.Page

{

common CM = new common();protected void Page_Load(object sender, EventArgs e)

{

//dataSet.ReadXml(Server.MapPath("../"+FileName));

}

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)

{

switch (DropDownList1.SelectedValue.ToString())

{

case "select": break;

case "1": SetReport("Offers.rdlc", "Mfg_Offers_MFG_Offers", "Select * from mfg_offers"); break;

case "2": SetReport("Mfg_Brand.rdlc", "MFG_Brand_MFG_Brand", "Select * from mfg_Brand where sample_url='" + Request.ServerVariables["HTTP_HOST"].ToLower() + "'"); break;

 

}

}

 

 

public void SetReport(string ReportFile, string ReportDataset, string spTarget)

{

ReportViewer reportViewer1 = new ReportViewer();

reportViewer1.ID = "ReportGenerator";

reportViewer1.SizeToReportContent = true;

reportViewer1.ProcessingMode = ProcessingMode.Local;

reportViewer1.LocalReport.ReportPath = Server.MapPath(@"\Reports\" + ReportFile);

reportViewer1.LocalReport.DataSources.Clear();

reportViewer1.LocalReport.DataSources.Add(
new ReportDataSource(ReportDataset, LoadReportData(spTarget)));

reportViewer1.Width = System.Web.UI.WebControls.Unit.Percentage(100.00);

reportViewer1.Height = System.Web.UI.WebControls.Unit.Pixel(400);

reportViewer1.LocalReport.Refresh();

PlaceHolder1.Controls.Remove(reportViewer1);

PlaceHolder1.Controls.Add(reportViewer1);

 

}

private DataTable LoadReportData(string spTarget)

{

DataSet dataSet = new DataSet();

dataSet = CM.RunQuery(spTarget);

return dataSet.Tables[0];

}

}

-1
mhariri
8/12/2007 2:35:41 AM

Okay. 

This is going to be long, but this is how I have always gotten it to work.  It might be necessary for you to copy each one of the following snippets a paste them as individual files in your system if you want to see them work in action.  Trust me in that it works like you want it to.

ReportSpike.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ReportSpike.aspx.cs" Inherits="ReportSpike" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Report Spike</title>
</head>
<body>
    <form id="ReportSpikeForm" runat="server">
        <div>
            <asp:Panel ID="ReportContent" runat="server">
                <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" Height="400px" Width="400px">
                </rsweb:ReportViewer>
                <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="RetrieveModelsByManufacturer" 
                        TypeName="VehicleRepository">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="1" Name="manufacturerID" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="RetrieveManufacturers" 
                        TypeName="VehicleRepository"></asp:ObjectDataSource>
            </asp:Panel>
            <asp:Button ID="Report1Button" runat="server" OnClick="Report1Button_Click" Text="Report 1" />
            <asp:Button ID="Report2Button" runat="server" OnClick="Report2Button_Click" Text="Report 2" />
        </div>
    </form>
</body>
</html>

ReportSpike.aspx.cs

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Reporting.WebForms;
using System.Drawing;

public partial class ReportSpike : System.Web.UI.Page {

    private void GenerateReport(string reportPath, string datasetName, string datasourceID) {
        ReportViewer newViewer = new Microsoft.Reporting.WebForms.ReportViewer();
        ReportDataSource source = new ReportDataSource(datasetName, datasourceID);

        newViewer.ID = "ReportViewer1";
        newViewer.Visible = true;
        newViewer.BackColor = Color.Transparent;
        newViewer.LinkActiveColor = Color.DarkBlue;
        newViewer.LinkActiveHoverColor = Color.DarkBlue;
        newViewer.ShowFindControls = false;
        newViewer.ShowPromptAreaButton = false;
        newViewer.ShowRefreshButton = false;
        newViewer.ShowZoomControl = false;
        newViewer.AsyncRendering = false;
        newViewer.SizeToReportContent = true;
        newViewer.ShowPageNavigationControls = false;
        newViewer.ShowExportControls = true;
        newViewer.ShowParameterPrompts = false;

        newViewer.LocalReport.ReportPath = Server.MapPath(reportPath);
        newViewer.LocalReport.DisplayName = "Display Name";
        newViewer.LocalReport.DataSources.Add(source);

        this.ReportContent.Controls.Remove(this.ReportViewer1);  //this is here because something needs to be removed in order for the ReportViewer to "reset"
        this.ReportContent.Controls.Add(newViewer);
    }

    protected void Report1Button_Click(object sender, EventArgs e) {
        this.GenerateReport("~/Reports/Report1.rdlc", "Manufacturer", "ObjectDataSource1");
    }

    protected void Report2Button_Click(object sender, EventArgs e) {
        this.GenerateReport("~/Reports/Report2.rdlc", "Model", "ObjectDataSource2");
    }
}

Domain Model

using System;
using System.Collections.Generic;

public class Manufacturer {

    public int ID {
        get { return id; }
        set { id = value; }
    }   private int id;

    public string Name {
        get { return name; }
        set { name = value; }
    }   private string name;
}

public class Model {

    public int ID {
        get { return id; }
        set { id = value; }
    }   private int id;

    public string Name {
        get { return name; }
        set { name = value; }
    }   private string name;

    public int ManufacturerID {
        get { return manufacturerID; }
        set { manufacturerID = value; }
    }   private int manufacturerID;
}

public class VehicleRepository {
    private static List manufacturers;
    private static List models;

    static VehicleRepository() {
        //imagine the following retrieved from the database

        manufacturers = new List();
        models = new List();

        for(int i = 1; i < 4; i++) {
            Manufacturer manufacturer = new Manufacturer();

            manufacturer.ID = i;
            manufacturer.Name = string.Concat("Manufacturer ", i);

            manufacturers.Add(manufacturer);
        }

        foreach(Manufacturer manufacturer in manufacturers) {
            for(int i = 1; i < 6; i++) {
                Model model = new Model();

                model.ID = (manufacturer.ID * 5) - 5 + i;
                model.Name = string.Concat("Model ", model.ID);
                model.ManufacturerID = manufacturer.ID;

                models.Add(model);
            }
        }
    }

    public static List RetrieveManufacturers() {
        return manufacturers;
    }

    public static List RetrieveModelsByManufacturer(int manufacturerID) {
        return models.FindAll(delegate(Model model) { return model.ManufacturerID == manufacturerID; });
    }
}
 

Report1.rdlc

<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
  <DataSources>
    <DataSource Name="DummyDataSource">
      <ConnectionProperties>
        <ConnectString />
        <DataProvider>SQL</DataProvider>
      </ConnectionProperties>
      <rd:DataSourceID>5d2446c4-be87-45b8-9829-90795f8000f9</rd:DataSourceID>
    </DataSource>
  </DataSources>
  <BottomMargin>1in</BottomMargin>
  <RightMargin>1in</RightMargin>
  <rd:DrawGrid>true</rd:DrawGrid>
  <InteractiveWidth>8.5in</InteractiveWidth>
  <rd:SnapToGrid>true</rd:SnapToGrid>
  <Body>
    <ReportItems>
      <Table Name="table1">
        <DataSetName>Manufacturer</DataSetName>
        <Top>0.25in</Top>
        <ZIndex>1</ZIndex>
        <Details>
          <TableRows>
            <TableRow>
              <TableCells>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="ID">
                      <rd:DefaultName>ID</rd:DefaultName>
                      <ZIndex>1</ZIndex>
                      <Style>
                        <TextAlign>Right</TextAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingBottom>2pt</PaddingBottom>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                      </Style>
                      <CanGrow>true</CanGrow>
                      <Value>=Fields!ID.Value</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="Name">
                      <rd:DefaultName>Name</rd:DefaultName>
                      <Style>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingBottom>2pt</PaddingBottom>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                      </Style>
                      <CanGrow>true</CanGrow>
                      <Value>=Fields!Name.Value</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
              </TableCells>
              <Height>0.25in</Height>
            </TableRow>
          </TableRows>
        </Details>
        <Header>
          <TableRows>
            <TableRow>
              <TableCells>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="textbox2">
                      <rd:DefaultName>textbox2</rd:DefaultName>
                      <ZIndex>3</ZIndex>
                      <Style>
                        <TextAlign>Right</TextAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingBottom>2pt</PaddingBottom>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                      </Style>
                      <CanGrow>true</CanGrow>
                      <Value>ID</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="textbox3">
                      <rd:DefaultName>textbox3</rd:DefaultName>
                      <ZIndex>2</ZIndex>
                      <Style>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingBottom>2pt</PaddingBottom>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                      </Style>
                      <CanGrow>true</CanGrow>
                      <Value>Name</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
              </TableCells>
              <Height>0.25in</Height>
            </TableRow>
          </TableRows>
        </Header>
        <TableColumns>
          <TableColumn>
            <Width>2.16667in</Width>
          </TableColumn>
          <TableColumn>
            <Width>2.16667in</Width>
          </TableColumn>
        </TableColumns>
      </Table>
      <Textbox Name="textbox1">
        <rd:DefaultName>textbox1</rd:DefaultName>
        <Width>4.25in</Width>
        <Style>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingBottom>2pt</PaddingBottom>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
        </Style>
        <CanGrow>true</CanGrow>
        <Height>0.25in</Height>
        <Value>Manufacturers</Value>
      </Textbox>
    </ReportItems>
    <Height>0.75in</Height>
  </Body>
  <rd:ReportID>61e5de95-0c5e-494d-9d07-ed8d65219087</rd:ReportID>
  <LeftMargin>1in</LeftMargin>
  <DataSets>
    <DataSet Name="Manufacturer">
      <rd:DataSetInfo>
        <rd:ObjectDataSourceSelectMethod>RetrieveManufacturers</rd:ObjectDataSourceSelectMethod>
        <rd:ObjectDataSourceType>VehicleRepository, App_Code.izgipq3m, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType>
      </rd:DataSetInfo>
      <Query>
        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
        <CommandText />
        <DataSourceName>DummyDataSource</DataSourceName>
      </Query>
      <Fields>
        <Field Name="ID">
          <rd:TypeName>System.Int32</rd:TypeName>
          <DataField>ID</DataField>
        </Field>
        <Field Name="Name">
          <rd:TypeName>System.String</rd:TypeName>
          <DataField>Name</DataField>
        </Field>
      </Fields>
    </DataSet>
  </DataSets>
  <Width>4.33334in</Width>
  <InteractiveHeight>11in</InteractiveHeight>
  <Language>en-US</Language>
  <TopMargin>1in</TopMargin>
</Report>
Report2.rdlc
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
  <DataSources>
    <DataSource Name="DummyDataSource">
      <ConnectionProperties>
        <ConnectString />
        <DataProvider>SQL</DataProvider>
      </ConnectionProperties>
      <rd:DataSourceID>ccc6ba71-c074-4aec-9032-6cc5bda11d67</rd:DataSourceID>
    </DataSource>
  </DataSources>
  <BottomMargin>1in</BottomMargin>
  <RightMargin>1in</RightMargin>
  <rd:DrawGrid>true</rd:DrawGrid>
  <InteractiveWidth>8.5in</InteractiveWidth>
  <rd:SnapToGrid>true</rd:SnapToGrid>
  <Body>
    <ReportItems>
      <Table Name="table1">
        <DataSetName>Model</DataSetName>
        <Top>0.25in</Top>
        <ZIndex>1</ZIndex>
        <Details>
          <TableRows>
            <TableRow>
              <TableCells>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="ID">
                      <rd:DefaultName>ID</rd:DefaultName>
                      <ZIndex>2</ZIndex>
                      <Style>
                        <TextAlign>Right</TextAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingBottom>2pt</PaddingBottom>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                      </Style>
                      <CanGrow>true</CanGrow>
                      <Value>=Fields!ID.Value</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="Name">
                      <rd:DefaultName>Name</rd:DefaultName>
                      <ZIndex>1</ZIndex>
                      <Style>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingBottom>2pt</PaddingBottom>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                      </Style>
                      <CanGrow>true</CanGrow>
                      <Value>=Fields!Name.Value</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="ManufacturerID">
                      <rd:DefaultName>ManufacturerID</rd:DefaultName>
                      <Style>
                        <TextAlign>Right</TextAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingBottom>2pt</PaddingBottom>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                      </Style>
                      <CanGrow>true</CanGrow>
                      <Value>=Fields!ManufacturerID.Value</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
              </TableCells>
              <Height>0.25in</Height>
            </TableRow>
          </TableRows>
        </Details>
        <Header>
          <TableRows>
            <TableRow>
              <TableCells>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="textbox2">
                      <rd:DefaultName>textbox2</rd:DefaultName>
                      <ZIndex>5</ZIndex>
                      <Style>
                        <TextAlign>Right</TextAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingBottom>2pt</PaddingBottom>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                      </Style>
                      <CanGrow>true</CanGrow>
                      <Value>ID</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="textbox3">
                      <rd:DefaultName>textbox3</rd:DefaultName>
                      <ZIndex>4</ZIndex>
                      <Style>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingBottom>2pt</PaddingBottom>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                      </Style>
                      <CanGrow>true</CanGrow>
                      <Value>Name</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
                <TableCell>
                  <ReportItems>
                    <Textbox Name="textbox4">
                      <rd:DefaultName>textbox4</rd:DefaultName>
                      <ZIndex>3</ZIndex>
                      <Style>
                        <TextAlign>Right</TextAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingBottom>2pt</PaddingBottom>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                      </Style>
                      <CanGrow>true</CanGrow>
                      <Value>Manufacturer ID</Value>
                    </Textbox>
                  </ReportItems>
                </TableCell>
              </TableCells>
              <Height>0.25in</Height>
            </TableRow>
          </TableRows>
        </Header>
        <TableColumns>
          <TableColumn>
            <Width>2.16667in</Width>
          </TableColumn>
          <TableColumn>
            <Width>2.16667in</Width>
          </TableColumn>
          <TableColumn>
            <Width>2.16667in</Width>
          </TableColumn>
        </TableColumns>
      </Table>
      <Textbox Name="textbox1">
        <rd:DefaultName>textbox1</rd:DefaultName>
        <Style>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingBottom>2pt</PaddingBottom>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
        </Style>
        <CanGrow>true</CanGrow>
        <Height>0.25in</Height>
        <Value>Models</Value>
      </Textbox>
    </ReportItems>
    <Height>0.75in</Height>
  </Body>
  <rd:ReportID>61e5de95-0c5e-494d-9d07-ed8d65219087</rd:ReportID>
  <LeftMargin>1in</LeftMargin>
  <DataSets>
    <DataSet Name="Model">
      <rd:DataSetInfo>
        <rd:ObjectDataSourceSelectMethod>RetrieveModelsByManufacturer</rd:ObjectDataSourceSelectMethod>
        <rd:ObjectDataSourceType>VehicleRepository, App_Code.izgipq3m, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType>
        <rd:ObjectDataSourceSelectMethodSignature>System.Collections.Generic.List`1[Model] RetrieveModelsByManufacturer(Int32)</rd:ObjectDataSourceSelectMethodSignature>
      </rd:DataSetInfo>
      <Query>
        <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
        <CommandText />
        <DataSourceName>DummyDataSource</DataSourceName>
      </Query>
      <Fields>
        <Field Name="ID">
          <rd:TypeName>System.Int32</rd:TypeName>
          <DataField>ID</DataField>
        </Field>
        <Field Name="Name">
          <rd:TypeName>System.String</rd:TypeName>
          <DataField>Name</DataField>
        </Field>
        <Field Name="ManufacturerID">
          <rd:TypeName>System.Int32</rd:TypeName>
          <DataField>ManufacturerID</DataField>
        </Field>
      </Fields>
    </DataSet>
  </DataSets>
  <Width>6.5in</Width>
  <InteractiveHeight>11in</InteractiveHeight>
  <Language>en-US</Language>
  <TopMargin>1in</TopMargin>
</Report>
 
That should do it.  Please let me know if this doesn't make sense.  If this is the answer please mark it as such.  Big Smile
Jason Conway
 
 

Jason Conway

MCP, MCTS, Certified SCRUM Master

asp.net blog
0
nicequy
8/12/2007 5:13:58 AM

Thank you very much for the complete answer to my question. I have no doubt this will work. I have one question. how do use the domain model in this code? Is it tied to a data source?

Mo

0
mhariri
8/14/2007 1:28:53 AM

Definitely!  Take a look at the markup in my ReportSpike.aspx above.  There are two ObjectDataSource controls.  Cool

Jason


Jason Conway

MCP, MCTS, Certified SCRUM Master

asp.net blog
0
nicequy
8/14/2007 3:44:41 AM
Reply:

Similar Artilces:

Report problem in ReportViewer control in Web Form
I used reporting services for client site in windows form application. I am using reporting services first time on the web ASP 2.0. I have draged ReportVeiwer control on my  web report Form and creating data source from sql databsase. When I am trying to connet datasource to in ReportViewer conntrol through smart tag. Then the application automatic closed.  I tried so many times with other computers also. I don't know this is a bug in VS 2005 or I am using wrongly. Please give example or link how to create web report  using  client side reporti...

Problem with dynamically loading report in ReportViewer control
 How can we load report dynamically in Report Viewer in .net2.0 in C#? ...

(Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.ReportViewer)
 I am trying to use ReportViewer 9 in Visual Studio 8 but I get this error when I try to run the page: The base class includes the field 'ReportViewer1', but its type (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.ReportViewer). Please help if you can! Thanks Please test it with a new clean project if the viewer works with VS2008.  Another stupid question, are you using viewer for WebForms or WinForms – I am sure there are two separate viewers (it is really stupid question but still please check it)....

I made three reports though reportviewer. The problem is when I call report A, after that even I call report B, still report A is shown.
Hi, All  I call report B with changing reportpath parameter, but report A is shown. I have 3 reports but even I change reportpath parameter, though the first selected is shown no matter what the report is. Once report C is shown, then even I call report B through reportpath parameter, though it shows still report C. Please help with this and thanks in advance for your help.  Can you please post the code?Sambeet Hi, Thanks for your reply. The code is as follows: As you see, I call 3 diffenrent reports depending on user's choice. Though, o...

I have problem Changing Gear like Icon to my Custom Control in vb.net
 I have four (4) problems 1.I designed a User control in vb.net but, have a problem on how to add AboutBox whereby if I click at it the control property the AboutBox form will Appear?   2. The designed User Control is showing with one Icon I don't like on the toolbox, How would I change the icon to display the one I want say "Simple.bmp"  on the toolbox?   3. I want to know how I can design an ellipses property like the one of FONT, such that when I click at it with will do anything I want it to do.   4. I need to design a co...

Remote Report Server 2005 using the reportviewer control
I am using an asp.net web page (C#) to access a remote Report Server via the reportviewer contol. After solving the credentials issues, all of my test reports seem to run very nicely if there is no parameter input. When a parameter report is executed, the text box for parameter input is displayed. When the parameter is entered and the View Report button is pressed, the report is NOT Returned. If I go directly to the remote Report Manager and run the report (IE no code behind), it runs as it is supposed to. I've also run the report (web page) on my local report server and it displays the ...

Changing the server for a Crystal Report using the ReportViewer control following the walkthrough example
  using: VS 20005, Assembly="CrystalDecisions.Web, Version=10.2.3600.0, I am following the basic walkthrough of how to setup a login for an embedded report: http://msdn.microsoft.com/en-us/library/ms227536(VS.80).aspx The code I am using is verbatim and is pasted below. What I am finding is that the SERVERNAME assignment is not respected. In fact the datasource for the report seems to be hardcoded into the report and a runtime change is not respected.  I think this because when I change the servername and run the code on my server I se my ORIGINAL servername that was setup...

Sql Server 2005 Reporting Service ReportViewer Control and Visual Studio.NET 2003
Hi, We have an ASP.NET 1.1 Application that is written using VS2003 but using SQL Server 2005 as database. Can we use Report Viewer Control that comes with SQL Server 2005 in our ASP.NET 1.1 Application?If not, Can some one suggest some alternative way of showing SQL Server 2005 Reports in ASP.NET 1.1  appllication.  ...

Problem with displaying report in Crystal report Viewer Activex Control
I am using Powerbuilder 9.0 with Crystal Report XI R2.I have a window w_report_window in my application with a Crystal Report 11.5 ActiveX Viewer Control(ole_crviewer) and a command button placed on it. I have set the Activation property of ole_crviewer to activateongetfocus!. I have a window w_searchcriteria where I enter the retrieval parameters for the report. When I click Ok button on w_searchcriteria the parameters entered by me are passed to w_report_window through a structure in the OpenwithParm() command. In the w_report_window I pass the structure values to the report usin...

New Server Control Rendering problem in Vvisual studio.net problem.
Hi every one, when i drag and drop my webserver control to the form in VS.net it shows a very small resizable bounding box type thing, and doesn't show the actual content and size of the control. I want the control to show the actual content and size of the control when i drag it on to the web form. The control works fine when i open the page holding the control in the browser. Can any one help me out here. Thanks. I am assuming that your rendering is being very specific about runtime? Could you shoot some code for your rendering part of the server control?-- Justin Lovell...

ReportViewer control problems
Sorry this post isnt about Crystal Reports per say, I am just trying to make a regular report work in Visual Studio 2005.  I am using reportviewer control to show a graph of some data on an asp.net page. It is working fine in the debugger, but when I move the code over to our testing server I get a runtime error, the runtime error shows up on the webpage and simply says:An error has occurred during report processing.Exception has been thrown by the target of an invocation.Object reference not set to an instance of an object. I tried instantiating the ReportViewer in code...

ReportViewer control problem
When i select an item from the dropdownlist the item does get selected but the reportviewer doesn't show a anythingbut i can see the toolbar of the reportviewer control. Thinks its a Postback issue but don't really know whats wrongThe dropdownlist  is bound to a sqldatasource in my aspx pagebut funny enough if i do a simple Response.Write("dsds");I can see the result  protected void Page_Load(object sender, EventArgs e) {   //DropDownList1.Items.Insert(0, new ListItem("<Choose Products>", "0"));int catid = Convert.To...

Problem with ReportViewer Control
Hi All,Any idea about how to print a multipage report in a web browser using the ReportViewer control???btw...i tried to use a jscript code to print the contents of the report...but it failed because it always print the whole page...Thanx You can't. That's unfortunately one of the limitations of the ReportViewer control. It is expected that you export the report out to PDF or Excel, then print from there.Thanks, EdMicrosoft MVP - ASP/ASP.NET I am researching ReportViewer, as I have never used it before.  Basically what I am trying to do is print out contents of a grid or other asp p...

Problems with the ReportViewer Control
The client side reportviewer control is used with a typed dataset in vs 2005. But I have noticed something that is really interesting, the turkish characters in the dataset are changed in the runtime enviroment when used with the reportviever control. such as.exec sp_executesql N'SELECT        CASES._ID, CASES._OWNERID, CASES._LASTMODIFYDATE, CASES._DELETIONSTATUS, CASES._SECURITYCODE, CASES._NAME, CASES._STATE,                      &n...

Web resources about - ReportViewer Problem - Why the report does not change - asp.net.presentation-controls

Mark Messier - Wikipedia, the free encyclopedia
Mark Douglas Messier ( / ˈ m ɛ s i . eɪ / ; born January 18, 1961) is a Canadian former professional ice hockey centre of the National Hockey ...

Blog Archive
Blog Archive 2013 75 Essential Tools for iOS Developers Aug 15 2013 posted in iOS Speaking at Cocoa Conf PDX Jul 13 2013 posted in Speaking In ...

William Vaughn's Musings: ReportViewer Archives
I’ve been tuning my monthly webinar again to include more information about SQL Server Reporting Services (R2) and Visual Studio 2010. This high-impact ...

Welcome to dbase
Cust_Ser_Tech_Support web site

Dr. Dobbs - UBM TechWeb
is a fully searchable DVD that includes: • 21 years of Dr. Dobb's Journal (1988-2009) • 14+ years of C/C++ Users Journal (1990-2006) • 17 years ...

Forums
SALES: 1-800-867-1380 ACCOUNT PORTALS Sign in FREE TRIAL SOLUTIONS Solutions Infrastructure Mobile Web Media Integration Identity & Access Management ...

SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, SQL Server 2005 Downloads, Videos, Support - TechNet ...
Evaluate SQL Server versions and features and find downloads, videos, installation and troubleshooting information, service packs, community ...

NHL On-line ReportViewer
VISITOR LOS ANGELES KINGS Game 2 Away Game 2 3 Game Summary Game 0013 Friday, October 10, 2003 Attendance 16,986 at Mellon Arena Start 7:44 ...

Archive
Articles Blog Videos Archive The Good, The Bad, and Everything In Between May 2014 Building Multiple Filters with Lo-Dash and AngularJS Compile, ...

Graduate Medical Education That Meets the Nation's Health Needs
Today's physician education system produces trained doctors with strong scientific underpinnings in biological and physical sciences as well ...

Resources last updated: 11/30/2015 11:53:27 AM