I am new to Crystal Report (version:xi). I have a Crystal Report consisting with a subreport to print the Invoicing Period. What I want to do it print the Invoicing period inside a paragraph in the Main Report. The Subreport has following codes.
Report Header: GetData
Details: #GetData
Report Footer: {#ShowData}
There are two formula fields
(1). GetData
global strPeriodBegin as string
global strPeriodEnd as string
if {REPORT_REQUEST_TMP.RRT_NAME}="INVOICING_PERIOD_BEGIN" then
strPeriodBegin= totext(cdate({REPORT_REQUEST_TMP.RRT_DATE}))
end if
if {REPORT_REQUEST_TMP.RRT_NAME}="INVOICING_PERIOD_END" then
strPeriodEnd= totext(cdate({REPORT_REQUEST_TMP.RRT_DATE}))
end if
formula = {REPORT_REQUEST_TMP.RRT_DATE}
(2). ShowData
'WhileReadingRecords
global strPeriodBegin as string
global strPeriodEnd as string
shared sh_strInvoicingPeriodHTML as string
sh_strInvoicingPeriodHTML= "Period : " & strPeriodBegin & " - " & strPeriodEnd
formula = strPeriodBegin & " - " & strPeriodEnd
Can anyone help me to Print this Invoicing Period inside a paragraph in Main Report.
what you can do is create a formula with a shared variable in the main report, then put that formula in the sub-report and store the value that the sub-report is returning in the shared variable that the formula has, then create another formula with that shared variable in the main report and put it in the paragraph. Notice that the formulas in the main report must be in different sections, for instance {#formula1} in the page header and {#formula2} in the report footer.
Related
I have a simple spreadsheet in Excel 97-2003 format, extension is XLS, that is throwing the following error when trying to load it with PHPSpreadSheet.
Error 0 on line 49 in \PhpSpreadsheet\Cell\CellAddress.php -> Row and Column Ids must be positive integer values
The spreadsheet has 14 columns with no formulas or external references. Similar spreadsheets in the same format load and process without error.
require 'PHPSpreadsheet/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xls();
$spreadsheet = $reader->load($inputfile); // <-- this is where the failure happens
If I create a new spreadsheet and copy the rows from the one that fails into the new one the load works just fine. The header row and 1 row of data are shown below. I have tried removing the header row and manually entering a single row but get the same failure.
It seems to be related to the file itself but the error message isn't helping to determine exactly what the problem is.
DATE Course ID Title of Class StartTime PGH Location Address City State Zip Code Sponsor/Vendor Instructor if Known Contact Information Telephone
1/10/2023 7280801 Dual Credit Water & Wastewater Workshop 08:00 6 Anywhere Fire Department 123 Main St Any Town NC 28580 NC Statewide Safety Conference, Inc. Sam Smith Joe Smith 252-555-1212
This was caused by a bug in PHPSpreadsheet that was revealed by having a vertical break in row H0 for some reason.
Removing the breaks in the spreadsheet manually would also correct the problem but the latest version of PHPSpreadsheet has been fixed so it will not thrown an error if there is a vertical break in the first row.
Hello and good day everyone!
I need your help and advise, i've one set of table and data as per below, and i'd like to use a formula to extract specific value from a single cell by using some value as indicator to indicate which text's line to extract.
Given the sample table as below,
Column A
Column B
Column C
This is example of the long texts value with multiple linethis text is very long also included value as below,Company: Apple IncContractor name: John Wick the value above, is per line.. and this text continue.. continue text..example text again..
This is where i'd like to display the Company name extracted from Column A
This is where i'd like to display Contractor name extracted from Column A
Example of what i want to achieve,
Column A
Column B
Column C
This is example of the long texts value with multiple line this text is very long also included value as below,Company: Apple IncContractor name: John Wick the value above, is per line.. and this text continue.. continue text..example text again..
Apple Inc
John Wick
I've tried with
LEFT()
MID()
=LEFT(A2,SEARCH("Company",A2)-1)
=REGEXREPLACE(A2,"(.*)Company(.*)","$2")
with no success.
May I request your advise and help on this please!
Thanks in advance.
In your situation, how about the following sample formula?
Sample formula:
Retrieve "Company name".
=TRIM(REGEXEXTRACT(A1,"Company:(.+)"))
Retrieve Contractor name
=TRIM(REGEXEXTRACT(A1,"Contractor name:(.+)"))
Testing:
When these formulas are used, the following result is obtained.
Note:
For example, the base data is put to the cells "A1:A3", you can also use the following formulas.
=ARRAYFORMULA(TRIM(REGEXEXTRACT(A1:A3,"Company:(.+)")))
=ARRAYFORMULA(TRIM(REGEXEXTRACT(A1:A3,"Contractor name:(.+)")))
Reference:
REGEXEXTRACT
I am using this script to get inlink modules info the script is working fine but its displaying output only in dxl window I want it also to reflect in a column when added as a attribute dxl can anyone help. Thanks in advance.
Object o = current
string srcModName
for srcModName in each (o<-"*") do print srcModName "\n"
print goes to the DXL window. display is for DXL Layout columns.
In DXL Layout columns there is a predefined variable obj which points to the object which is currently being calculated. This is not the current object, which is the one that the user has clicked on.
Create a DXL Layout column with the following code
string srcModName
for srcModName in each (obj<-"*") do display srcModName "\n"
Edit: code for a DXL attribute would be different. For this you would use obj.attrDXLName = "value"
I have a column containing 60 Text string entries in google sheet. These are job posts.
one of the entry look like this.
"Procurement Manager (MEP & Civil) urgently (Construction experience is Mandatory).Company - Kleindienst experience - Experience with 5-star hotels & luxury project will be preferred, min 10 years’ experience with same level position."
in another worksheet in google sheet i have a column containing more than 2000 job titles.
Say Sheet2!A1:A2000 .
I want if there is any job titles which is in another google work sheet is present in above text string then show that job title in next coulmn.
I used following formula of vlookup but failed to extract job title. sheet name in this case is Data Lookup , A2:A2000 contains all job titles in Data lookup sheet where 9 column contains same jobs titles for lookup value. C2 contains jobs descriptions as mentioned above.
=VLOOKUP(C2,'Data Lookup'!A2:A2000,9,FALSE)
but this formula is giving error. how can i get job titles.
You might want to consider using this custom function to achieve your goal.
Sample Code:
/** *
* #customfunction
*/
function findmatch(text, list){
var result = 'Not Found';
list = list.flat();
list.forEach( str => {
if(text.includes(str)){
result = str;
return result;
}
});
return result;
}
What it does?
provide the text string in the first parameter then the list of job titles on the 2nd parameter
Change 2-d array to 1-d array using Array.flat()
Loop all job titles and check if the text string contains the current job title using String.includes()
Return the matched job title.
Output:
Formula: =findMatch(A2,$C$2:$C$10)
Note: I used $ to lock the job title range so that it wont adjust while you drag your formula.
(UPDATE)
Here is an example if your job titles' are found on another sheet Data Lookup
Formula: =findMatch(A2,'Data Lookup'!$A$2:$A$10)
Here is an example if your job titles' are found on another Google Sheet
Pre-requisite:
Use Importrange() formula first to give access to the Google Sheet being imported.
Importrange Formula: =IMPORTRANGE("Your sheet url","$A$2:$A$10")
Formula: =findMatch(A2,importrange("Your sheet url","$A$2:$A$10"))
try:
=VLOOKUP(C2; 'Data Lookup'!I:J; 2; 0)
it translates as: look for C2 in column I and if match is found return column J
I have an table in an MS Excel 2010. The table has two columns. The first column is a name of a person (Col A), the second column is the marks that the person secured in an exam (Col B).
I am applying conditional formatting. If I choose the following wizard
Home > Conditional Formatting > Format all cells based on their values
I can color the Col B on a 3-color scale. This is exactly what I want. However, I want it for the entire row and not only the cell in Col B. I want the name also to be formatted in the same color as the marks.
Anyone knows how to do this?
I have already looked around a bit. The following came close to did not solve the particular problem that I am trying to.
http://www.howtogeek.com/howto/45670/how-to-highlight-a-row-in-excel-using-conditional-formatting/
Conditional Formatting Rows Based on Date
You're probably going to have to use VBA code for this.
Right click the worksheet label and select 'View Code'
Inside the code window, paste in the following code:
Sub RunMe()
Dim xRng As Range, xCell As Range
With Me
Set xRng = .Range(.Cells(2, 2), .Cells(.Rows.Count, 2).End(xlUp))
' Change the first '2' above to reflect the starting row of your data
For Each xCell In xRng
xCell.Offset(0, -1).Interior.Color = xCell.DisplayFormat.Interior.Color
Next xCell
End With
End Sub
Now every time you run the macro (Alt-F8, select macro), column A will be formatted with the conditional formatting assigned to column B.
If you want this process to be automatic, change:
Sub RunMe()
to something like:
Private Sub Worksheet_Activate()
' This will run the macro whenever the worksheet is selected
or you could assign the code to a keyboard shortcut or a command button etc.
If you would like the code to run every time the file is opened, saved closed etc, add the code instead to the ThisWorkbook code window (although you'd have to alter the code slightly as 'Me' is referencing the particular worksheet in which the code is placed).