Click here to Skip to main content
11,928,078 members (52,366 online)
Rate this:
Please Sign up or sign in to vote.
See more: .NET .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
    public partial class rtAllUseTaxGroupAssignment : Form
      public rtAllUseTaxGroupAssignment()
	public M3.Globals.UserContext CurrentUserContext { get; set; }
	public NHSessionManager.SessionForWindows WSession { get; set; }
	public List<tuttaxgroup> GroupList { get; set; }
	private void viewerAllGroupAssignment_Load(object sender, EventArgs e)
	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))
	List<printtaxassignment> lstAssignPrint = new List<printtaxassignment>();
	foreach (var itemGroupList in GroupList)
	 M3.UT.BAL.UT obj = new M3.UT.BAL.UT(WSession.CreateSession());
	 List<tax> 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;
	ar.DataSource = lstAssignPrint;
	viewerAllGroupAssignment.Document = ar.Document;
	catch (Exception ex)
	CusException cex = new CusException(ex);
Posted 10-May-13 11:45am
Edited 10-May-13 11:49am

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.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