I creted a web project with visual studio 2005 express but the report
 is blank.
 My report's source is on MySql; I connect runtime and send datatable
 to the report.
 this is the rdlc file; I canceled some rows
 [code]
 <?xml version="1.0" encoding="utf-8"?>
 <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/
 2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/
 SQLServer/reporting/reportdesigner">
 <PageWidth>21cm</PageWidth>
 <rd:DrawGrid>true</rd:DrawGrid>
 <InteractiveWidth>21cm</InteractiveWidth>
 <rd:GridSpacing>0.25cm</rd:GridSpacing>
 <rd:SnapToGrid>true</rd:SnapToGrid>
 <Body>
 <ColumnSpacing>1cm</ColumnSpacing>
 <ReportItems>
 <Textbox Name="comune">
 <Left>0.25cm</Left>
 <Top>0.25cm</Top>
 <rd:DefaultName>comune</rd:DefaultName>
 <ZIndex>1</ZIndex>
 <Width>14.25cm</Width>
 <Style>
 <PaddingLeft>2pt</PaddingLeft>
 <PaddingBottom>2pt</PaddingBottom>
 <PaddingRight>2pt</PaddingRight>
 <PaddingTop>2pt</PaddingTop>
 </Style>
 <CanGrow>true</CanGrow>
 <Height>0.63492cm</Height>
 <Value>=First(Fields!comune.Value)</Value>
 </Textbox>
 <Textbox Name="textbox2">
 <Left>15cm</Left>
 <Top>0.25cm</Top>
 <rd:DefaultName>textbox2</rd:DefaultName>
 <Width>3.99471cm</Width>
 <Style>
 <PaddingLeft>2pt</PaddingLeft>
 <PaddingBottom>2pt</PaddingBottom>
 <PaddingRight>2pt</PaddingRight>
 <PaddingTop>2pt</PaddingTop>
 </Style>
 <CanGrow>true</CanGrow>
 <Height>1.00529cm</Height>
 <Value>Scheda cliente</Value>
 </Textbox>
 </ReportItems>
 <Height>25cm</Height>
 </Body>
 <rd:ReportID>2c8fb28d-af14-4a5f-b557-de3fbbfb5378</rd:ReportID>
 <DataSources>
 <DataSource Name="reminder_local">
 <ConnectionProperties>
 <ConnectString />
 <DataProvider>OLEDB</DataProvider>
 </ConnectionProperties>
 <rd:DataSourceID>47284d9e-3aa3-4350-9732-405dc3c0abbf</
 rd:DataSourceID>
 </DataSource>
 </DataSources>
 <DataSets>
 <DataSet Name="DSCliente">
 <rd:DataSetInfo>
 <rd:TableAdapterGetDataMethod>GetData</
 rd:TableAdapterGetDataMethod>
 <rd:DataSetName>dbDataSet</rd:DataSetName>
 <rd:TableAdapterFillMethod>Fill</rd:TableAdapterFillMethod>
 <rd:TableAdapterName>ProductsTableAdapter</
 rd:TableAdapterName>
 <rd:TableName>tbCliente</rd:TableName>
 </rd:DataSetInfo>
 <Query>
 <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
 <CommandText>select * from tbCliente</CommandText>
 <DataSourceName>reminder_local</DataSourceName>
 </Query>
 <Fields>
 <Field Name="id">
 <rd:TypeName>System.Int64</rd:TypeName>
 <DataField>id</DataField>
 </Field>
 <Field Name="ragsoc">
 <rd:TypeName>System.String</rd:TypeName>
 <DataField>ragsoc</DataField>
 </Field>
 <Field Name="via">
 <rd:TypeName>System.String</rd:TypeName>
 <DataField>via</DataField>
 </Field>
 <Field Name="comune">
 <rd:TypeName>System.String</rd:TypeName>
 <DataField>comune</DataField>
 </Field>
 <Field Name="prov">
 <rd:TypeName>System.String</rd:TypeName>
 <DataField>prov</DataField>
 </Field>
 </Fields>
 ... fields tolti...
 </DataSet>
 </DataSets>
 <Width>20.25cm</Width>
 <InteractiveHeight>29.7cm</InteractiveHeight>
 <Language>en-US</Language>
 <PageHeight>29.7cm</PageHeight>
 </Report>
 [/code]
 and this is the page code loading the report
 [code]
 protected void Page_Load(object sender, EventArgs e)
 {
 DataSet dsCliente = new DataSet();
 dsCliente.DataSetName = "DsCliente";
 MySqlConnection mycnn = new
 MySqlConnection(ConfigurationManager.ConnectionStrings["reminder_local"].ToString());
 MySqlCommand cmd = new MySqlCommand();
 MySqlDataAdapter DA = new MySqlDataAdapter();
 cmd.Connection = mycnn;
 cmd.CommandType = CommandType.StoredProcedure;
 cmd.Parameters.Add(new MySqlParameter("P_ID", 1));
 cmd.Parameters.Add(new MySqlParameter("P_AncheAnnullati",
 "True"));
 cmd.CommandText = "spSelectClienteByID";
 DA.SelectCommand = cmd;
 DA.Fill(dsCliente);
 dsCliente.Tables[0].TableName = "tbCliente";
 rwScheda.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
 rwScheda.LocalReport.ReportPath = MapPath("SchedeClienti.rdlc");
 ReportDataSource rptDS = new ReportDataSource();
 rptDS.Name = "DSCliente";
 rptDS.Value = dsCliente.Tables[0];
 rwScheda.LocalReport.DataSources.Add(rptDS);
 rwScheda.DataBind();
 //rwScheda.LocalReport.Refresh();
 }
 [/code]
 I've already seen that in the table there is one record.
 Why I don't see anything'I answer myself
I put the property AsyncRendering="false" on the reportviewer object
in the aspx page
and now works fine.
Subscribe to:
Post Comments (Atom)
 
No comments:
Post a Comment