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
  {
 
    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 10-May-13 11:45am
Edited 10-May-13 11:49am
(no name)33.2K
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 295
1 DamithSL 265
2 CPallini 235
3 Maciej Los 190
4 Sergey Alexandrovich Kryukov 174
0 OriginalGriff 5,415
1 DamithSL 4,422
2 Maciej Los 3,820
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,911


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 10 May 2013
Copyright © CodeProject, 1999-2014
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