none
XSD to Crystal Reports in asp.net??? RRS feed

  • Question

  • Any help would be awesome!!! I have created a DataSet Class that is called dataSet.xsd. I also created a Crystal Report that was able to read and place fields in the report that my dataSet.xsd file defines but when i run the report my data does not show... I am new to Crystal Reports.

    I know now that the dataSet.xsd file needs to be called by a TableAdapter (let me know if i am wrong) that is then passed into the Report but i have not had much luck using Code that was found in other forms... I feel like i am just missing some small piece of the puzzle, so any help would be awesome!! :)

    Also if there is a better way to do this other than DataSet.xsd file please let me know... I started using them because it created the SQL for me.

     

     

    Saturday, October 29, 2011 11:39 PM

All replies

  • Hi,
    You can try to use Crystal Report with Dataset in this way:
    private void button1_Click(object sender, EventArgs e)
            {
                DataSet1 ds = new DataSet1();
                DataTable t = ds.Tables.Add("Items");
                t.Columns.Add("id", Type.GetType("System.Int32"));
                t.Columns.Add("Item", Type.GetType("System.String"));
    
                DataRow r ;
                int i = 0;
                for (i = 0; i <= 9; i++)
                {
                    r = t.NewRow();
                    r["id"] = i;
                    r["Item"] = "Item" + i;
                    t.Rows.Add(r);
                }
    
                CrystalReport1 objRpt = new CrystalReport1();
                objRpt.SetDataSource(ds.Tables[1]);
                crystalReportViewer1.ReportSource = objRpt;
                crystalReportViewer1.Refresh(); 
            }
    
    
    Have a nice day.

    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, October 31, 2011 2:58 AM
    Moderator
  • Is that the best way to do it? Also in asp.net it will not let me say:

    CrystalReport1 objRpt = new CrystalReport1();

    For some reason i cant reference the report i created... missing assembly maybe?

    I found something saying that you can use Entity data models for crystal reports data sources... would that be worth a shot? Having trouble figuring out what people use the most to grab data from .mdf databases...

    Saturday, November 5, 2011 6:01 AM
  • Hi,

    thanks for your feedback.

    To tell your truth, I'm not good at Crystal Report, but you should install right version CR for VS, for further qeustion, you'd better repost here: http://forums.sdn.sap.com/forum.jspa?forumID=300, thanks for understanding.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, November 10, 2011 8:48 AM
    Moderator