Creating an array from table in crystal reports formula - crystal-reports-2008

I have a very small view created (only 6 rows and 2 columns).
I wish to read the values of the view into a 2D array using crystal reports.
Can this be achieved in using formulas in crystal reports?
If yes, how can i do that? IF not, is there any other alternative.? CANNOT USE SUB-REPORT
I am a beginner to crystal reports. Any help would really be appreciated.
Thanks in advance.

I am confused on why you need to read columns from database.
Pick the rows into array and use it in report.
If I am understanding wrong elaborate more on what you required exactly, I will try to help.

Below is the code that takes the row from table and displays it in report.Create a formula add below code
local numberVar i1;
For i1:=1 to Count(table.field) do
(
Shared StringVar Array a:=[Field1, Filed2 ,... Add as many fields you have];
);
Now create individual formulas for every column and place the forlumas side by side in details section
E.g
Formula 1:
Shared StringVar Array a;
a[1];
Formula 2:
Shared StringVar Array a;
a[2];
Report
Formula 1 formula 2 ......
Let me know if you still face any issue.

Related

How to create a custom formula using data validation that can sort columns using column numbers in Google Sheets?

I hope someone can help with a problem I’m facing. I’m pretty new to Data Validation using Custom Formulas so I’d appreciate your guidance. I hope I have explained the situation clearly. Thanks.
I want to use data validation in cell B1 (Portfolio Tab) which creates a drop down list of the number of columns (1 to 44). I want to use the list as a way to sort a table (Column Headers - C3:AT4).
https://docs.google.com/spreadsheets/d/1qunKbFGNzzGU9lNCPFow8igkR_gaPudmanTK-WM43mA/edit#gid=58173089
By selecting 1 from the drop down list I want my table to be sorted in Descending order by Portfolio%. Then if I want to sort by Name in Descending order I want to select 3 from the drop down list. Finally once I’m done sorting I want to revert back/reset to my original view. I want to do this without changing anything in columns A and B. Please assist. Thank You.
Issue with using asc
Issue with using asc (blank formula)
Query and hyperlink
Query and hyperlink
solution 1:
forget dropdown and use filter view inmerge row 3 & 4
delete row 1 & 4
select your range C2:AT
and creatte filter view
now you can sort one, multiple or all columns like:
solution 2:
create a duplicate of your sheet:
delete your range C3:AT
use this in C3:
=QUERY({Portfolio!C3:AT}, "order by Col"&B1&" desc", 2)
solution 3:
use sorting script... https://stackoverflow.com/questions/tagged/google-apps-script+sorting

Is it possible to get the last row filled?

In gspread, is it possible to get the last row or cell number that is filled?
The API reference page doesn't seem to help.
Gspread has "row_count", but I am not sure it returns all rows in a spreadsheet, or just the filled ones. If that doesn't help, there is a slightly less direct, but completely functional way to do it:
1.) let's assume your data is in column A, and it has been filled in consecutively row by row (i.e. no skipped rows)
2.) in another free cell in your spreadsheet--let's assume cell B1--use the native Google Sheets function COUNTA, which will count the number of values in a dataset, and specify column A as the target, i.e. "=COUNTA(A:A)"
3.) now just request the value of cell B1 with gspread's acell, i.e. "last_row_updated = myWorksheet.acell("B1").value"
You can use the following code, taken from this answer to this similar question:
def last_filled_row(worksheet):
str_list = list(filter(None, worksheet.col_values(1)))
return len(str_list)

how to make matrix based on the row data in google spreadsheet

I have a google spreadsheet which matches submodules and product. Below is what sheet looks like.
What I want to do is transform this data to matrix such like below.
Can I make it with one function? I want to use it in Mmult function so it would be better matrix without labels.
I cannot catch any ID to get through it. Hope I get good clues to do it. Thanks a lot.
Not quite the result you show from the data sample provided, but I think at least close to what you want:
=query(A2:C5,"select B, sum(C) group by B pivot A")
To get a 0 in the pivot table I added a row in the source data.

How to customize partial sum in QlikView Pivot table

I'm a beginner for QlikView. I learnt that by going to presentation tab and click on show partial sum box and subtotal box, I can get the partial sum and subtotal. But my task is to calculate the average which means (subtotal/no of record)/ (partial sum/no of record). I've been suggested to use set analysis to calculate too. I have somehow calculated the numerator part but unable to get denominator.
This is my numerator :
Let vNumerator = 'SUM({<ACTIVITY={num1,num2}>} BOX_COUNT)/Count (record1 & record2)';
Any help is much appreciated.
From this scrap data
load * inline [
A,B,C,D,E
1,21,a,b,z,x
2,22,b,b,z,x
3,23,a,a,x,z
4,24,b,b,x,z
5,25,b,a,x,x
6,21,a,b,z,x
7,22,b,b,z,x
8,23,a,a,x,z
9,24,b,b,x,z
10,25,b,a,x,x
11,21,a,b,z,x
12,22,b,b,z,x
13,23,a,a,x,z
14,24,b,b,x,z
15,25,b,a,x,x
16,21,a,b,z,x
17,22,b,b,z,x
18,23,a,a,x,z
19,24,b,b,x,z
20,25,b,a,x,x
];
Which of these tables is what you are looking for out of the data?
All of these by defining a third expression as a combination of the others rather than trying to force it into an automatic subtotal.
Or make a table that shows the answers you want and post a picture of it. Even in excel is fine.
Also please let me know if I'm a million miles off the track here.
If you want to sum over ACTIVITY you need to use the following syntax:
sum( TOTAL<ACTIVITY> _your_expression_with_Set_ananaysis_ )
/
count( TOTAL<ACTIVITY> record1 & record2 )

How to create a table with lines and columns using Ireport?

I'am using JasperReport and ireport 4.0 , I want to know If their the possibility to create a table that can I fix lines and columns? Because the only the table that I have found allowed me just to fix columns !!
And
For the charts I have just an integer values but I dont know what the scale use float numbers!
Update:
what I mean that ireport allowed this format:
and I want the following format:
Thank you
Typically you have a varying number of rows, because the number of rows depend on the data from your database.
To have a known number of rows you either have to make sure that your data has the expected number of rows, or you design your detail section in a way that corresponds to your desired outcome. The height of the detail section is flexible, and you can put various text fields not only side by side, but also on top of each other.

Resources