locked
Reports asp.net 2005 RRS feed

  • Question

  • User-1026607750 posted

    Hi,

    1. How do I use the vs 2005, asp.net reportsview with classes and not just a typed dataset?

    2. What is the best way to show reports on Asp.Net? the reports viewer? google charts? I would appriciate some help.

     

    Thanks in advance,

    Dani. 

    Sunday, November 29, 2009 9:09 AM

Answers

  • User514892507 posted

    Assume you have a class "Product" with fields productname and productprice

    Public class Product

    { public string ProductName {get;set;}

    public int ProductPrice {get;set;}

    public Product(string name,int price)

    {

      ProductName=name;

    ProductPrice=price;}}

    Then use this class 

    List<Product> products=new List<Product>(); products.Add(new Product("Pen", 15));products.Add(new Product("book", 15));

    With reportviewer

    ReportViewer.LocalReport.ReportPath = "rdlc file name";ReportViewer.LocalReport.DataSources.Add(new ReportDataSource("Product", products));

    To answer second part of your question, it is better to use report viewer with asp.net the reason is simple as both belong to same technology i.e Microsoft hence no compatibility issues.




    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, November 29, 2009 10:51 AM
  • User-1026607750 posted

    Hi,

    thanks for your help,

    It doesn;t show anything should or how do I relate the rdlc to the class?

    Thanks in advance 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 30, 2009 3:22 AM

All replies

  • User514892507 posted

    Assume you have a class "Product" with fields productname and productprice

    Public class Product

    { public string ProductName {get;set;}

    public int ProductPrice {get;set;}

    public Product(string name,int price)

    {

      ProductName=name;

    ProductPrice=price;}}

    Then use this class 

    List<Product> products=new List<Product>(); products.Add(new Product("Pen", 15));products.Add(new Product("book", 15));

    With reportviewer

    ReportViewer.LocalReport.ReportPath = "rdlc file name";ReportViewer.LocalReport.DataSources.Add(new ReportDataSource("Product", products));

    To answer second part of your question, it is better to use report viewer with asp.net the reason is simple as both belong to same technology i.e Microsoft hence no compatibility issues.




    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, November 29, 2009 10:51 AM
  • User-1026607750 posted

    Hi,

    thanks for your help,

    It doesn;t show anything should or how do I relate the rdlc to the class?

    Thanks in advance 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 30, 2009 3:22 AM
  • User-1026607750 posted

     the probelm rely in the rdlc component

    Monday, March 8, 2010 11:50 AM