Chris__T
Posts: 339
|
Posted: 07/26/2010, 11:42 AM |
|
Using CCS to eliminate a user's need for reports being done in excel. But the user wants the report to look the same.
Her report (well, just excel rows/columns) takes up 22 lines on a page. (22 rows in the table)
How can I take a CCS report and pad the table with rows to equal up to the 22 rows?
example. if i have 10 rows of data, I want 12 blank rows.
|
|
|
lboeldt
Posts: 53
|
Posted: 07/26/2010, 10:08 PM |
|
Hi Chris,
Go into your pages html, In your report footer, just above the "no records" section add a label called "Buffer".
Add the following code to the server BeforeShow event (my table is called people you'll have to adjust for your code accordingly):
Function people_Report_Footer_Buffer_BeforeShow(Sender) 'people_Report_Footer_Buffer_BeforeShow @21-20C6FB8B
'Custom Code @23-73254650
' -------------------------
' Write your own code here.
' -------------------------
dim r: r=people.TotalRows
dim s: s = ""
dim i: i = 0
if r < 22 then
for i = 1 to 22-r
s = s & "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>"
next
end if
people.Buffer.Value=s
'End Custom Code
End Function 'Close people_Report_Footer_Buffer_BeforeShow @21-54C34B28
Alter the s=s&"<tr>....</tr>" line to contain as many <td> </td> entries as you have columns in your table.
|
|
|
Chris__T
Posts: 339
|
Posted: 07/28/2010, 8:47 AM |
|
Do I put it in the "No Records" section or above it? Seems like when I put it above, it sticks the Buffer label outside of the report
Do you have a snippet of your HTML so I can see where to put it?
Reading through the code, I understand how this works, but I can't get the buffer label in the right spot
|
|
|
Chris__T
Posts: 339
|
Posted: 07/28/2010, 9:06 AM |
|
Well, I was able to get it to work sort of. Now I'm just getting a whole bunch of <tr><td> </td> code inserted into the report, like it's not turning the code into actual rows/columns
It is giving me the correct number of "rows", but it's all in the html code, not actual rows.
Yeah, it's just storing the code in the label. The label isn't converting it to displayed rows.
Also set Buffer label content to "html" instead of "text", but that just got rid of the html code on the report, and no added rows.
|
|
|
Chris__T
Posts: 339
|
Posted: 07/28/2010, 12:41 PM |
|
is Buffer supposed to be a form label or html label?
|
|
|
lboeldt
Posts: 53
|
Posted: 07/28/2010, 2:21 PM |
|
Hi Chris, Buffer should be an HTML label, sorry I missed that step.
LB
|
|
|
Chris__T
Posts: 339
|
Posted: 07/28/2010, 2:27 PM |
|
Ok, I'm not familiar with html labels working in CCS. How can you have an html label be connected to the code?
form.Buffer.value is not a valid control for an html label. or am I doing something wrong?
|
|
|
lboeldt
Posts: 53
|
Posted: 07/28/2010, 2:45 PM |
|
Ok maybe we need to step back for a second.
When you say HTML label do you mean this kind of label?
<label for="wxyz">myabel</label>
If so that's the wrong type of label. What I'm taking about is a form control in Code Charge Studio that is called "label". The label has a property that lets you choose text or HTML. This type of label would look like: {Buffer} in the HTML and designer.
Change the content property of your label from "Text" to "HTML" in the label property's data tab.
|
|
|
Chris__T
Posts: 339
|
Posted: 07/28/2010, 2:50 PM |
|
Ok, yeah I initially meant a form control label {Buffer} and setting it's content type to HTML
I tried that, but nothing happened.
do you have a piece of your html code that you can post so I can see where in the report footer to put it?
|
|
|
lboeldt
Posts: 53
|
Posted: 07/28/2010, 10:22 PM |
|
What are the columns in the table? I'll make you CCS project with your columns as a working example.
|
|
|
Chris__T
Posts: 339
|
Posted: 07/29/2010, 7:05 AM |
|
My columns are:
Permit (with Permit_No the label attached to the db field)
Address (with Job_Site the label attached to the db field)
Inspection Type (with Inspection_Type .......)
Result (no data , blank column)
Owner/Contractor (with Contact .......)
Project (with Inspection_Time, Notes as labels......)
Arrive (no data, blank column)
Depart (no data, blank column)
Thanks for your help.
|
|
|
lboeldt
Posts: 53
|
Posted: 07/29/2010, 9:29 AM |
|
Hi Chris here's an example project.
http://web-developer.boeldt.net/file/buffered_report.zip
Create a folder c:\projects\_cc4\
Drag the "buffered_report" folder in the zip file to c:\projects\_cc4\
If you choose to use another directory you'll need to reconfigure the database connection (conn) to point at the MS Access DB where it resides on your hard drive.
LB
|
|
|
Chris__T
Posts: 339
|
Posted: 07/29/2010, 12:03 PM |
|
A very big THANK YOU!!!
I brought up your example project. Worked like a charm, then started implementing the code in my project, and it looks great!
I can't thank you enough! :):)
|
|
|
lboeldt
Posts: 53
|
Posted: 07/29/2010, 6:50 PM |
|
Fantastic! Please mark this as [Resolved].
|
|
|