in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

C1WebReport

Last post 04-15-2008 5:32 PM by C1_AndrewM. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-11-2008 2:44 AM

    C1WebReport

     

  • 04-11-2008 4:34 PM In reply to

    Re: C1WebReport

    Please comment the following line in the page load event in your code and it should work fine.
     
    C1WebReport1.Report.Clear();
     
    Regards,
    Patrick
    <cshekharin> wrote in message news:203732@10.0.1.98...

    when i run the application . nothing is displaying in c1webreport control . can u plz assit me what  went wrong

    the following is the code

     html

    <cc1:C1WebReport ID="C1WebReport1" runat="server" Height="640px" Width="608px">

    <NavigationBar Style-BackColor="Control">

    </NavigationBar>

    </cc1:C1WebReport>

    <br />

    <asp:TextBox ID="TextBox1" runat="server" Width="272px">Enter the Name of the Customer...</asp:TextBox>

     

    <asp:Button ID="startSearch" runat="server" OnClick="startSearch_Click" Text="StartSearch"

    Width="136px" /><br /> 

    aspx code

    SqlConnection myConnection;

    DataSet myDataSet;

    SqlDataAdapter myDataReader;

    protected void Page_Load(object sender, EventArgs e)

    {

    tempPath = Request.MapPath(
    "Proc.xml");

    C1WebReport1.Cache.Clear();

    C1WebReport1.ReportSource.FileName = tempPath;

    C1WebReport1.ReportSource.ReportName =
    "New Report 1";

    C1WebReport1.Report.Clear();

    C1WebReport1.Cache.Clear();

    C1WebReport1.Visible =
    false;

    myConnection = new SqlConnection();

    }

    protected void startSearch_Click(object sender, EventArgs e)

    {

    C1WebReport1.Cache.Clear();

    myConnection.ConnectionString =
    ConfigurationManager.ConnectionStrings["constr"].ConnectionString.ToString();

    myConnection.Open();

    myDataReader =
    new SqlDataAdapter("GetCust", myConnection);

    myDataReader.SelectCommand.CommandType = CommandType.StoredProcedure;

    myDataReader.SelectCommand.Parameters.Add("@contname", SqlDbType.VarChar, 20);

    myDataReader.SelectCommand.Parameters[0].Value = TextBox1.Text;

    myDataSet =
    new DataSet();

    myDataReader.Fill(myDataSet);

    C1WebReport1.Report.DataSource.Recordset = myDataSet.Tables[0];

    C1WebReport1.DataBind();

    C1WebReport1.Visible =
    true;

    myConnection.Close();

    }

    the xml file is

    proc.xml

     

    <?xml version="1.0"?>
    <Reports>
      <!--Report *** New Report 1 ***-->
      <Report version="2.5.20073.258">
        <Name>New Report 1</Name>
        <ReportInfo>
          <Author>Gary Bigman</Author>
        </ReportInfo>
        <DataSource>
          <RecordSource>PARAMETERS contname string '';
    getCust(contname)</RecordSource>
        </DataSource>
        <Layout>
          <Orientation>1</Orientation>
        </Layout>
        <Font>
          <Name>Times New Roman</Name>
          <Size>9</Size>
        </Font>
        <Groups />
        <Sections>
          <Section>
            <Name>Detail</Name>
            <Type>0</Type>
            <Height>500</Height>
          </Section>
          <Section>
            <Name>Header</Name>
            <Type>1</Type>
            <Height>800</Height>
            <BackColor>16777215</BackColor>
          </Section>
          <Section>
            <Name>Footer</Name>
            <Type>2</Type>
            <Visible>0</Visible>
          </Section>
          <Section>
            <Name>PageHeader</Name>
            <Type>3</Type>
            <Height>600</Height>
          </Section>
          <Section>
            <Name>PageFooter</Name>
            <Type>4</Type>
            <Height>500</Height>
          </Section>
        </Sections>
        <Fields>
          <Field>
            <Name>titleLbl</Name>
            <Section>1</Section>
            <Text>New Report</Text>
            <Top>200</Top>
            <Width>9360</Width>
            <Height>600</Height>
            <Align>6</Align>
            <ForeColor>128</ForeColor>
            <Font>
              <Bold>-1</Bold>
              <Name>Times New Roman</Name>
              <Size>20</Size>
            </Font>
          </Field>
          <Field>
            <Name>ftrLeft</Name>
            <Section>4</Section>
            <Text>Now()</Text>
            <Calculated>-1</Calculated>
            <Top>30</Top>
            <Width>4680</Width>
            <Height>300</Height>
            <Align>0</Align>
            <Font>
              <Name>Arial</Name>
              <Size>9</Size>
            </Font>
          </Field>
          <Field>
            <Name>ftrRight</Name>
            <Section>4</Section>
            <Text>"Page " &amp; [Page] &amp; " of " &amp; [Pages]</Text>
            <Calculated>-1</Calculated>
            <Left>4680</Left>
            <Top>30</Top>
            <Width>4680</Width>
            <Height>300</Height>
            <Align>2</Align>
            <Font>
              <Name>Arial</Name>
              <Size>9</Size>
            </Font>
          </Field>
          <Field>
            <Name>CompanyNameLbl</Name>
            <Section>3</Section>
            <Text>Title</Text>
            <Top>100</Top>
            <Width>2880</Width>
            <Height>400</Height>
            <Align>3</Align>
            <ForeColor>128</ForeColor>
            <WordWrap>0</WordWrap>
            <Font>
              <Bold>-1</Bold>
              <Name>Arial</Name>
              <Size>10</Size>
            </Font>
          </Field>
          <Field>
            <Name>customerIDLbl</Name>
            <Section>3</Section>
            <Text>ProposalID</Text>
            <Left>2900</Left>
            <Top>100</Top>
            <Width>800</Width>
            <Height>400</Height>
            <Align>3</Align>
            <ForeColor>128</ForeColor>
            <WordWrap>0</WordWrap>
            <Font>
              <Bold>-1</Bold>
              <Name>Arial</Name>
              <Size>10</Size>
            </Font>
          </Field>
          <Field>
            <Name>CompanyNameCtl</Name>
            <Section>0</Section>
            <Text>Title</Text>
            <Calculated>-1</Calculated>
            <Top>100</Top>
            <Width>2880</Width>
            <Height>300</Height>
            <Align>0</Align>
            <CanGrow>-1</CanGrow>
          </Field>
          <Field>
            <Name>customerIDCtl</Name>
            <Section>0</Section>
            <Text>ProposalID</Text>
            <Calculated>-1</Calculated>
            <Left>2900</Left>
            <Top>100</Top>
            <Width>800</Width>
            <Height>300</Height>
            <Align>0</Align>
          </Field>
          <Field>
            <Name>divLine</Name>
            <Section>3</Section>
            <Top>540</Top>
            <Width>9360</Width>
            <Height>60</Height>
            <BackColor>0</BackColor>
            <BackStyle>1</BackStyle>
          </Field>
        </Fields>
      </Report>
    </Reports>

     

     



    http://helpcentral.componentone.com/cs/forums/p/74916/203732.aspx#203732

  • 04-15-2008 5:32 PM In reply to

    Re: C1WebReport

    Hello,
     
    Please remove following lines of code from Form Load event:

    C1WebReport1.Report.Clear();

    C1WebReport1.Cache.Clear();

    Regards,

    Andrew

    <cshekharin> wrote in message news:203732@10.0.1.98...

    when i run the application . nothing is displaying in c1webreport control . can u plz assit me what  went wrong

    the following is the code

     html

    <cc1:C1WebReport ID="C1WebReport1" runat="server" Height="640px" Width="608px">

    <NavigationBar Style-BackColor="Control">

    </NavigationBar>

    </cc1:C1WebReport>

    <br />

    <asp:TextBox ID="TextBox1" runat="server" Width="272px">Enter the Name of the Customer...</asp:TextBox>

     

    <asp:Button ID="startSearch" runat="server" OnClick="startSearch_Click" Text="StartSearch"

    Width="136px" /><br /> 

    aspx code

    SqlConnection myConnection;

    DataSet myDataSet;

    SqlDataAdapter myDataReader;

    protected void Page_Load(object sender, EventArgs e)

    {

    tempPath = Request.MapPath(
    "Proc.xml");

    C1WebReport1.Cache.Clear();

    C1WebReport1.ReportSource.FileName = tempPath;

    C1WebReport1.ReportSource.ReportName =
    "New Report 1";

    C1WebReport1.Report.Clear();

    C1WebReport1.Cache.Clear();

    C1WebReport1.Visible =
    false;

    myConnection = new SqlConnection();

    }

    protected void startSearch_Click(object sender, EventArgs e)

    {

    C1WebReport1.Cache.Clear();

    myConnection.ConnectionString =
    ConfigurationManager.ConnectionStrings["constr"].ConnectionString.ToString();

    myConnection.Open();

    myDataReader =
    new SqlDataAdapter("GetCust", myConnection);

    myDataReader.SelectCommand.CommandType = CommandType.StoredProcedure;

    myDataReader.SelectCommand.Parameters.Add("@contname", SqlDbType.VarChar, 20);

    myDataReader.SelectCommand.Parameters[0].Value = TextBox1.Text;

    myDataSet =
    new DataSet();

    myDataReader.Fill(myDataSet);

    C1WebReport1.Report.DataSource.Recordset = myDataSet.Tables[0];

    C1WebReport1.DataBind();

    C1WebReport1.Visible =
    true;

    myConnection.Close();

    }

    the xml file is

    proc.xml

     

    <?xml version="1.0"?>
    <Reports>
      <!--Report *** New Report 1 ***-->
      <Report version="2.5.20073.258">
        <Name>New Report 1</Name>
        <ReportInfo>
          <Author>Gary Bigman</Author>
        </ReportInfo>
        <DataSource>
          <RecordSource>PARAMETERS contname string '';
    getCust(contname)</RecordSource>
        </DataSource>
        <Layout>
          <Orientation>1</Orientation>
        </Layout>
        <Font>
          <Name>Times New Roman</Name>
          <Size>9</Size>
        </Font>
        <Groups />
        <Sections>
          <Section>
            <Name>Detail</Name>
            <Type>0</Type>
            <Height>500</Height>
          </Section>
          <Section>
            <Name>Header</Name>
            <Type>1</Type>
            <Height>800</Height>
            <BackColor>16777215</BackColor>
          </Section>
          <Section>
            <Name>Footer</Name>
            <Type>2</Type>
            <Visible>0</Visible>
          </Section>
          <Section>
            <Name>PageHeader</Name>
            <Type>3</Type>
            <Height>600</Height>
          </Section>
          <Section>
            <Name>PageFooter</Name>
            <Type>4</Type>
            <Height>500</Height>
          </Section>
        </Sections>
        <Fields>
          <Field>
            <Name>titleLbl</Name>
            <Section>1</Section>
            <Text>New Report</Text>
            <Top>200</Top>
            <Width>9360</Width>
            <Height>600</Height>
            <Align>6</Align>
            <ForeColor>128</ForeColor>
            <Font>
              <Bold>-1</Bold>
              <Name>Times New Roman</Name>
              <Size>20</Size>
            </Font>
          </Field>
          <Field>
            <Name>ftrLeft</Name>
            <Section>4</Section>
            <Text>Now()</Text>
            <Calculated>-1</Calculated>
            <Top>30</Top>
            <Width>4680</Width>
            <Height>300</Height>
            <Align>0</Align>
            <Font>
              <Name>Arial</Name>
              <Size>9</Size>
            </Font>
          </Field>
          <Field>
            <Name>ftrRight</Name>
            <Section>4</Section>
            <Text>"Page " &amp; [Page] &amp; " of " &amp; [Pages]</Text>
            <Calculated>-1</Calculated>
            <Left>4680</Left>
            <Top>30</Top>
            <Width>4680</Width>
            <Height>300</Height>
            <Align>2</Align>
            <Font>
              <Name>Arial</Name>
              <Size>9</Size>
            </Font>
          </Field>
          <Field>
            <Name>CompanyNameLbl</Name>
            <Section>3</Section>
            <Text>Title</Text>
            <Top>100</Top>
            <Width>2880</Width>
            <Height>400</Height>
            <Align>3</Align>
            <ForeColor>128</ForeColor>
            <WordWrap>0</WordWrap>
            <Font>
              <Bold>-1</Bold>
              <Name>Arial</Name>
              <Size>10</Size>
            </Font>
          </Field>
          <Field>
            <Name>customerIDLbl</Name>
            <Section>3</Section>
            <Text>ProposalID</Text>
            <Left>2900</Left>
            <Top>100</Top>
            <Width>800</Width>
            <Height>400</Height>
            <Align>3</Align>
            <ForeColor>128</ForeColor>
            <WordWrap>0</WordWrap>
            <Font>
              <Bold>-1</Bold>
              <Name>Arial</Name>
              <Size>10</Size>
            </Font>
          </Field>
          <Field>
            <Name>CompanyNameCtl</Name>
            <Section>0</Section>
            <Text>Title</Text>
            <Calculated>-1</Calculated>
            <Top>100</Top>
            <Width>2880</Width>
            <Height>300</Height>
            <Align>0</Align>
            <CanGrow>-1</CanGrow>
          </Field>
          <Field>
            <Name>customerIDCtl</Name>
            <Section>0</Section>
            <Text>ProposalID</Text>
            <Calculated>-1</Calculated>
            <Left>2900</Left>
            <Top>100</Top>
            <Width>800</Width>
            <Height>300</Height>
            <Align>0</Align>
          </Field>
          <Field>
            <Name>divLine</Name>
            <Section>3</Section>
            <Top>540</Top>
            <Width>9360</Width>
            <Height>60</Height>
            <BackColor>0</BackColor>
            <BackStyle>1</BackStyle>
          </Field>
        </Fields>
      </Report>
    </Reports>

     

     



    http://helpcentral.componentone.com/cs/forums/p/74916/203732.aspx#203732

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.