Auto increment column
-
- Posts: 6
- Joined: Thu Jun 23, 2016 1:18 pm
Auto increment column
Hello.
I need to create a column with auto increment, depending of the lines in Data Band.
Here is the solution for a simple MySQL query, http://stackoverflow.com/questions/1186 ... d-in-the-r, how can i adapt this functionality in a StimulSoft->DataSource->query.
Thanks,
Vadim
I need to create a column with auto increment, depending of the lines in Data Band.
Here is the solution for a simple MySQL query, http://stackoverflow.com/questions/1186 ... d-in-the-r, how can i adapt this functionality in a StimulSoft->DataSource->query.
Thanks,
Vadim
Re: Auto increment column
Hello,
You can use the system variable {Line} from the Dictionary on the data band for this task.
Thank you.
You can use the system variable {Line} from the Dictionary on the data band for this task.
Thank you.
-
- Posts: 6
- Joined: Thu Jun 23, 2016 1:18 pm
Re: Auto increment column
Hi Aleksey.
Thanks for the idea, but in my case i can't use.
For example: we have 'x' large chapters with subchapters, in a query, i make a "UNION" and receive the respective chapters with subchapters: [chapter 1 , chapter 2, ..., subchapter 1, ..., subchapter 10].
Now, i want to make a classification/ordering, to look like this:
1 Chapter 1
1.1 Subchapter 1
1.2 Subchapter 2
...
10 Chapter 10
10.1 Subchapter 10
...
In a simple MySQL query, i use the code from the link i've put above, but i can adopt to Data Source->query.
Thanks
Thanks for the idea, but in my case i can't use.
For example: we have 'x' large chapters with subchapters, in a query, i make a "UNION" and receive the respective chapters with subchapters: [chapter 1 , chapter 2, ..., subchapter 1, ..., subchapter 10].
Now, i want to make a classification/ordering, to look like this:
1 Chapter 1
1.1 Subchapter 1
1.2 Subchapter 2
...
10 Chapter 10
10.1 Subchapter 10
...
In a simple MySQL query, i use the code from the link i've put above, but i can adopt to Data Source->query.
Thanks
Re: Auto increment column
Hello,
We need some additional time for investigating the issue. We will let you know about the result.
Thank you.
We need some additional time for investigating the issue. We will let you know about the result.
Thank you.
-
- Posts: 6
- Joined: Thu Jun 23, 2016 1:18 pm
Re: Auto increment column
Thank you much, let me know about results.
Re: Auto increment column
Hello,
Please check the sample report template in the attachment.
We used an additional variable and a script to organize autoincrement.
We do not have your data, so the example uses our database.
Let us know if you need any additional help.
Thank you.
Please check the sample report template in the attachment.
We used an additional variable and a script to organize autoincrement.
We do not have your data, so the example uses our database.
Let us know if you need any additional help.
Thank you.
- Attachments
-
- ReportSample.mrt
- (8.51 KiB) Downloaded 526 times
Re: Auto increment column
Hello,
Also, you can use stored procedure for this task. In this case, you can create Stored Procedure for this task.
And then use in the data source as:
But in this case, in PHP version you need to add all columns manually. In JS(HTML5) version retrieve columns works correctly.
Thank you.
Also, you can use stored procedure for this task. In this case, you can create Stored Procedure for this task.
Code: Select all
CREATE DEFINER=`root`@`localhost` PROCEDURE `incrementSelect`()
BEGIN
SELECT @s:=@s+1 serial_number, product_name, list_price
FROM products,
(SELECT @s:= 0) AS s;
END
Code: Select all
call incrementSelect();
Thank you.
- Attachments
-
- 02.PNG (230.32 KiB) Viewed 4336 times
-
- 01.PNG (76.75 KiB) Viewed 4336 times