|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
asp.net 2 report problem with 3-tier designHow do you create a report when you have a 3-tier web application? I have a
class that does all the data accessing for me, so I don't have direct access to datasets in the user interface tier. I was hoping I could just cheat the report with a dummy dataset structure nut I'm not sure how to go about creating the dummy dataset. The alternative would be to create the report in code at runtime but I'm not sure if that's possible either. I can't find any examples of this. Can anyone help? Thanks, Bernie Beattie You can reference your business (or directly to your data) layer in your
reporting layer. So, for example, on your reporting project, reference the business layer project in your solution (add reference > projects > business layer project, in this case, called myBizLayer). Now, you have access to the datagrids and functions of that project. From here, if you have a call to get information based off a user input number, say a part lookup. Your business layer contains a select for this that outputs a DataRow. -- Show quoteHide quoteint partNumber = Convert.ToInt32(lblPartNumber.Text); DataRow partInfo = myBizLayer.getPartInfo(partNumber); -- From here, you can use that DataRow (or DataSet, DataTable, etc) however you please in your reporting project. Most of my projects are separated by business, data, presentation (web, usually), and reporting. I use DataDynamics ActiveReports and have found this to work like a champ and still keep the layers of logic separated. If this isn't what you're meaning, reply back with an example or pseudocode of how you're calling the data in your presentation tier and we can go from there. :) -dl -- David Longnecker Web Developer Wichita Public Schools, USD 259 > How do you create a report when you have a 3-tier web application? I > have a class that does all the data accessing for me, so I don't have > direct access to datasets in the user interface tier. I was hoping I > could just cheat the report with a dummy dataset structure nut I'm not > sure how to go about creating the dummy dataset. > > The alternative would be to create the report in code at runtime but > I'm not sure if that's possible either. I can't find any examples of > this. > > Can anyone help? > > Thanks, > > Bernie Beattie > Thanks for your reply David. First time anyone has replied to any of my posts!
I'm trying to use the asp.net 2.0 in-built reporting (rdlc) with a chart control dropped on, but it requires to have a dataset/table bound immediately when you create the report. This is the bit I'm finding tricky as the data is accessed via a separate tier. I was hoping I could trick the report into working by having a dummy business object with the fields that will be in my dataset and somehow rebind the data at runtime. But it doesn't seem to work. Maybe I need a different approach or use a different chart tool? Thanks for your help, Bernie Beattie Show quoteHide quote "David R. Longnecker" wrote: > You can reference your business (or directly to your data) layer in your > reporting layer. > > So, for example, on your reporting project, reference the business layer > project in your solution (add reference > projects > business layer project, > in this case, called myBizLayer). Now, you have access to the datagrids > and functions of that project. > > From here, if you have a call to get information based off a user input number, > say a part lookup. Your business layer contains a select for this that outputs > a DataRow. > > -- > int partNumber = Convert.ToInt32(lblPartNumber.Text); > DataRow partInfo = myBizLayer.getPartInfo(partNumber); > -- > > From here, you can use that DataRow (or DataSet, DataTable, etc) however > you please in your reporting project. Most of my projects are separated by > business, data, presentation (web, usually), and reporting. I use DataDynamics > ActiveReports and have found this to work like a champ and still keep the > layers of logic separated. > > If this isn't what you're meaning, reply back with an example or pseudocode > of how you're calling the data in your presentation tier and we can go from > there. :) > > -dl > > -- > David Longnecker > Web Developer > Wichita Public Schools, USD 259 > > > How do you create a report when you have a 3-tier web application? I > > have a class that does all the data accessing for me, so I don't have > > direct access to datasets in the user interface tier. I was hoping I > > could just cheat the report with a dummy dataset structure nut I'm not > > sure how to go about creating the dummy dataset. > > > > The alternative would be to create the report in code at runtime but > > I'm not sure if that's possible either. I can't find any examples of > > this. > > > > Can anyone help? > > > > Thanks, > > > > Bernie Beattie > > > > >
http://msdn2.microsoft.com/en-us/library/ms251784.aspx
Now, I'll be the first to admit that I left the RDLC reporting behind because it... frankly, didn't make sense to me. ;) I'm sure it's very powerful and that it's just a learning curve for me, but none-the-less. I didn't like some of the complexities that it appeared to add and currently use ActiveReports. The article above describes how to expose your business objects and then adding an Object data source and referencing your class from there. One thing it doesn't point out in bold is what to do if your business objects are in another project. If that's the case, be sure to add a Reference (under adding an Object data source, click Add Reference > Projects and select your project, or browse if it's not a member of yoru current solution.). From the example, you should be able to then drag/drop and/or associate your data sets and values to charts, tables, matrices, etc. -dl Show quoteHide quote > Thanks for your reply David. First time anyone has replied to any of > my posts! > > I'm trying to use the asp.net 2.0 in-built reporting (rdlc) with a > chart control dropped on, but it requires to have a dataset/table > bound immediately when you create the report. This is the bit I'm > finding tricky as the data is accessed via a separate tier. I was > hoping I could trick the report into working by having a dummy > business object with the fields that will be in my dataset and somehow > rebind the data at runtime. But it doesn't seem to work. > > Maybe I need a different approach or use a different chart tool? > > Thanks for your help, > > Bernie Beattie > > "David R. Longnecker" wrote: > >> You can reference your business (or directly to your data) layer in >> your reporting layer. >> >> So, for example, on your reporting project, reference the business >> layer project in your solution (add reference > projects > business >> layer project, in this case, called myBizLayer). Now, you have >> access to the datagrids and functions of that project. >> >> From here, if you have a call to get information based off a user >> input number, say a part lookup. Your business layer contains a >> select for this that outputs a DataRow. >> >> -- >> int partNumber = Convert.ToInt32(lblPartNumber.Text); >> DataRow partInfo = myBizLayer.getPartInfo(partNumber); >> -- >> From here, you can use that DataRow (or DataSet, DataTable, etc) >> however you please in your reporting project. Most of my projects are >> separated by business, data, presentation (web, usually), and >> reporting. I use DataDynamics ActiveReports and have found this to >> work like a champ and still keep the layers of logic separated. >> >> If this isn't what you're meaning, reply back with an example or >> pseudocode of how you're calling the data in your presentation tier >> and we can go from there. :) >> >> -dl >> >> -- >> David Longnecker >> Web Developer >> Wichita Public Schools, USD 259 >>> How do you create a report when you have a 3-tier web application? >>> I have a class that does all the data accessing for me, so I don't >>> have direct access to datasets in the user interface tier. I was >>> hoping I could just cheat the report with a dummy dataset structure >>> nut I'm not sure how to go about creating the dummy dataset. >>> >>> The alternative would be to create the report in code at runtime but >>> I'm not sure if that's possible either. I can't find any examples of >>> this. >>> >>> Can anyone help? >>> >>> Thanks, >>> >>> Bernie Beattie >>>
Using ASP.NET 2.0's ImageMap Control
Treeview Styles Aren't working How to hide the "Edit" link in DetailsView via code? White strip showing up between two imagemaps UserControls in a different directory ASP code Controls calling other controls problem - ASP.NET 2.0 Authentication in ASP.NET 2.0 create webcontrols in aspx or aspx.cs DropDownList SelectedIndexChanged |
|||||||||||||||||||||||