Ordering in CrossDataBand?

Stimulsoft Reports.NET discussion
amitkaushik
Posts: 74
Joined: Fri Dec 07, 2012 11:35 am

Re: Ordering in CrossDataBand?

Post by amitkaushik »

Yes its working fine.

Thank you Aleksey :)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Ordering in CrossDataBand?

Post by HighAley »

Hello.

We are always glad to help you.
Let us know if you need any additional help.

Thank you.
amitkaushik
Posts: 74
Joined: Fri Dec 07, 2012 11:35 am

Re: Ordering in CrossDataBand?

Post by amitkaushik »

Thanks,

But I have a problem with this report. I increase the size of that report and showing more sections by adding more cross header, cross data and databand and now the size of report is 2 page.
it work fine when i supply data limited to 2 page but when I am adding more records in datasource the report pages are unordered like;

Page 1, Page 1, Page 2, Page2

But what i am looking for is

Page 1, Page 2, Page 1,Page2

.....

thankyou
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Ordering in CrossDataBand?

Post by HighAley »

Hello.

Please, try to set the Collate property of the report to 2.

Thank you.
amitkaushik
Posts: 74
Joined: Fri Dec 07, 2012 11:35 am

Re: Ordering in CrossDataBand?

Post by amitkaushik »

I try with lines

StiReport report1 = new StiReport();
report1.Load(templatePath);
report1.Collate = 2;
DataSet ds = new DataSet("Test");
ds = DataSET(IDs);
report1.Dictionary.DataSources.Clear();
report1.RegData(ds);
report1.Dictionary.Synchronize();
report1.Compile();
report1.Render();
return report1;
but it does't work.
Please provide me an sample mrt.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Ordering in CrossDataBand?

Post by Alex K. »

Hello,

Please send us your report with test data which reproduces the issue for analysis.

Thank you.
amitkaushik
Posts: 74
Joined: Fri Dec 07, 2012 11:35 am

Re: Ordering in CrossDataBand?

Post by amitkaushik »

it may help u to reproduce the issue.

create TABLE [dbo].[Product](
[ProductID] [int] IDENTITY(1,1) NOT NULL,
[ProductName] [varchar](50) NOT NULL,
[CompantName] [varchar](50) NOT NULL
)

insert into [dbo].[Product] values('Prod1','Comp1')
insert into [dbo].[Product] values('Prod2','Comp2')
insert into [dbo].[Product] values('Prod3','Comp3')
insert into [dbo].[Product] values('Prod4','Comp4')
insert into [dbo].[Product] values('Prod5','Comp5')
insert into [dbo].[Product] values('Prod6','Comp6')
insert into [dbo].[Product] values('Prod7','Comp7')
insert into [dbo].[Product] values('Prod8','Comp8')
insert into [dbo].[Product] values('Prod9','Comp9')
insert into [dbo].[Product] values('Prod10','Comp10')
insert into [dbo].[Product] values('Prod11','Comp11')

--------------------------------------------------------------------------

Create FUNCTION [dbo].[Split]
(
@RowData varchar(8000),
@SplitOn nvarchar(5)
)
RETURNS @RtnValue table
(
Id int identity(1,1),
Data varchar(8000)
)
AS
BEGIN
Declare @Cnt int
Set @Cnt = 1
While (Charindex(@SplitOn,@RowData)>0)
Begin
Insert Into @RtnValue (data)
Select Data = ltrim(rtrim(Substring(@RowData,1,Charindex(@SplitOn,@RowData)-1)))
Set @RowData = Substring(@RowData,Charindex(@SplitOn,@RowData)+1,len(@RowData))
Set @Cnt = @Cnt + 1
End
Insert Into @RtnValue (data)
Select Data = ltrim(rtrim(@RowData))
Return
END

---------------------------------------------------------------------------
Create PROCEDURE [dbo].[sp_Product_Info]
@ProductID varchar(MAX)
AS

DECLARE @ProductIDcount int
SELECT @ProductIDcount = COUNT(*) FROM dbo.Split(@ProductID ,',')

DECLARE @Table TABLE( ProductID int, ProductName Varchar(max),[CompantName] Varchar(max));

DECLARE @intFlag INT, @ProdID int, @RowCount int

SET @intFlag = 1
WHILE (@intFlag < = @ProductIDcount)
BEGIN
SELECT @ProdID = data FROM dbo.Split(@ProductID , ',') where Id = @intFlag

select @RowCount = Count(*) FROM [dbo].[Product]
WHERE ProductID = @ProdID

if(@RowCount > 0)
begin
INSERT @Table
SELECT DISTINCT ProductID, [CompantName], ProductName
FROM [dbo].[Product]
WHERE ProductID = @ProdID
End
else
begin
INSERT @Table VALUES (@ProdID, '','')
end
SET @intFlag = @intFlag + 1
END
SELECT * FROM @Table
Attachments
Report.mrt
(70.43 KiB) Downloaded 190 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Ordering in CrossDataBand?

Post by Alex K. »

Hello,

Please send us a screenshot or image how is shows now and how it should look like.

Thank you.
amitkaushik
Posts: 74
Joined: Fri Dec 07, 2012 11:35 am

Re: Ordering in CrossDataBand?

Post by amitkaushik »

Please find the image and mrt.
and one more thing I want to add, C# Code is used to supply datasource in this scenario.
Attachments
Screen
Screen
Test.JPG (105.14 KiB) Viewed 2809 times
Report.mrt
(70.54 KiB) Downloaded 203 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Ordering in CrossDataBand?

Post by HighAley »

Hello.

Please, try to set the Collate property of the report to 2.

Thank you.
Post Reply