Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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.
C#
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()
      {
       InitializeComponent();
      }

	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)
	{
	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<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;
	}
	lstAssignPrint.Add(ObjAssignPrint);

	}

	}

	}

	ar.DataSource = lstAssignPrint;

	ar.Run();

	viewerAllGroupAssignment.Document = ar.Document;

	}

	catch (Exception ex)
	{

	CusException cex = new CusException(ex);
	cex.Show(

	MessageBoxIcon.Error);
	}

	}

	
	}

	}
Posted
Updated 10-May-13 10:49am
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900