Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET4
Hi guys,

I stuck on active reports:

mainly we use two type of reports one is .cs base and another is .rpx(xml)base. I am working on .rpx (xml type) so can anyone make a sample for me or u can guide me.main problem is that we are using nhibernate to make our application database independent type so we are binding main report and subreport data at my formviewer(.rpx need a viewer to show reports). So didn't get how i bind data in my subreport.

I am using reflection to load my .rpx report layout in my viewer file i am showing my one report sample.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DataDynamics.ActiveReports;
using System.Reflection;
using System.Xml;
using M3.Entities;
using M3.UDT;
 
namespace Reports.UT
  {
 
<pre>
public partial class rtAllUseTaxGroupAssignment : Form
{
 
  public rtAllUseTaxGroupAssignment()
  {
   InitializeComponent();
  }
 
public M3.Globals.UserContext CurrentUserContext { get; set; }
public NHSessionManager.SessionForWindows WSession { get; set; }
public List&lt;tuttaxgroup&gt; GroupList { get; set; }
private void viewerAllGroupAssignment_Load(object sender, EventArgs e)
{
try
{
ActiveReport ar = new ActiveReport();
Assembly asm = Assembly.GetAssembly(this.GetType());
System.IO.Stream stre = asm.GetManifestResourceStream(asm.GetName().Name + ".UT.arUseTaxGroupAssignments.rpx");
using (XmlTextReader xr = new XmlTextReader(stre))
{
 ar.LoadLayout(xr);
}
 
List&lt;printtaxassignment&gt; lstAssignPrint = new List&lt;printtaxassignment&gt;();
foreach (var itemGroupList in GroupList)
{
 
 M3.UT.BAL.UT obj = new M3.UT.BAL.UT(WSession.CreateSession());
 List&lt;tax&gt; lstTax = obj.LoadUseTax(itemGroupList.FGroupID);
 foreach (var item in lstTax)
 {
      foreach (var itemGL in item.TuTax.TUTTaxGroupAssignments)
  {
       PrintTaxAssignment ObjAssignPrint = new PrintTaxAssignment();
   ObjAssignPrint.FName = itemGroupList.FName;
 
   ObjAssignPrint.FDescription = itemGroupList.FDescription;
 
   ObjAssignPrint.FEffectiveDate = itemGroupList.FEffectiveDate;
 
   ObjAssignPrint.TaxName = item.TaxName;
 
   ObjAssignPrint.TaxDescName = item.Description;
 
   ObjAssignPrint.TaxFDateAdded = item.TuTax.FDateAdded;
 
   ObjAssignPrint.TaxFDateAddedBy = item.TuTax.FAddedBy;
 
   ObjAssignPrint.FDateModified = item.TuTax.FDateModified;
 
   ObjAssignPrint.FModifiedBy = item.TuTax.FModifiedBy;
 
   ObjAssignPrint.CreditGL = itemGL.FCreditGLNumber;
 
   ObjAssignPrint.DebitGL = itemGL.FDebitGLNumber;
 
   ObjAssignPrint.DebitCT = itemGL.FDebitCTCode;
 
if (itemGL.TSCCompany != null && itemGL.TSCProperty == null)
{
 ObjAssignPrint.EntityName = itemGL.TSCCompany.FName;
}
 
else if (itemGL.TSCCompany != null && itemGL.TSCProperty != null)
{
 ObjAssignPrint.EntityName = itemGL.TSCProperty.FName;
}
lstAssignPrint.Add(ObjAssignPrint);
 
}
 
}
 
}
 
ar.DataSource = lstAssignPrint;
 
ar.Run();
 
viewerAllGroupAssignment.Document = ar.Document;
 
}
 
catch (Exception ex)
{
 
CusException cex = new CusException(ex);
cex.Show(
 
MessageBoxIcon.Error);
}
 
}
 
}
 
}</pre>
Posted 10-May-13 11:45am
Edited 10-May-13 11:49am
(no name)33.4K
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 490
1 Sergey Alexandrovich Kryukov 405
2 Maciej Los 285
3 ProgramFOX 265
4 Peter Leow 210
0 OriginalGriff 490
1 Sergey Alexandrovich Kryukov 405
2 Maciej Los 285
3 ProgramFOX 265
4 Peter Leow 210


Advertise | Privacy | Mobile
Web01 | 2.8.150331.1 | Last Updated 10 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100