R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
Printing data from ListX
Last Post 01 Jan 1900 05:00 AM by . 58 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Page 1 of 3123 > >>
Author Messages Informative
jpolichnUser is Offline
New Member
New Member
Posts:34

--
25 Sep 2006 09:41 PM  
Is there no print function for listX module?
Id like for my end users to run a report using listX and then
allow them to print it out via the standard dnn module print icon.
pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
25 Sep 2006 11:13 PM  
Can you not just display the report in a listx module then use the print icon?
ListX....makes you look brilliant, even though you're not.
jpolichnUser is Offline
New Member
New Member
Posts:34

--
26 Sep 2006 11:11 AM  
Im trying to just print the information that is within this one module. I went into the settings and clicked the allow print check box but do not get a print icon to allow users to print the info within the module.
???
pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
27 Sep 2006 05:14 AM  
Apply a standard DNN container. You should see the print icon then. It is controlled by your skin container on the module, not ListX.
ListX....makes you look brilliant, even though you're not.
jpolichnUser is Offline
New Member
New Member
Posts:34

--
27 Sep 2006 11:14 AM  
When I add other dnn modules I get the print Icon to show up fine. When I add the ListX module I can only get the excel icon to show no print, no xml. I have tried to reinstall the module and that didn't do it either.
pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
27 Sep 2006 09:16 PM  
What do you mean when you say "add the listx module" ? Sorry...confused. Apply a standard DNN container to the Module Settings of the Container that has the ListX Module already in it.
ListX....makes you look brilliant, even though you're not.
jpolichnUser is Offline
New Member
New Member
Posts:34

--
28 Sep 2006 02:01 PM  
ok I have tried what you said and applied a standard dnn container to my module and the print icon appears. When I log in as a standard user I don't get the print Icon on the ListX modules, I only get them on the standard dnn modules? I have checked to make sure printing is enabled and it is on all modules. I have even tried adding a new page then adding a listx module. At this point I see the print icon from all users, but as soon as i add my variables,query,and table I no longer get the print icon for all users only admins? Is there a setting somewhere or something I may be doing wrong somewhere??

Here is the xml of my page

<?xml version="1.0" encoding="utf-16"?>
<xListSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<recordsPerPage>0</recordsPerPage>
<enableAlphaFilter>false</enableAlphaFilter>
<enablePageSelection>false</enablePageSelection>
<enableRecordsPerPage>false</enableRecordsPerPage>
<enableCustomPaging>false</enableCustomPaging>
<enableExcelExport>true</enableExcelExport>
<enableHide_OnNoQuery>false</enableHide_OnNoQuery>
<enableHide_OnNoResults>false</enableHide_OnNoResults>
<enableAdvancedParsing>true</enableAdvancedParsing>
<enableQueryDebug>false</enableQueryDebug>
<enableQueryDebug_Edit>false</enableQueryDebug_Edit>
<enableQueryDebug_Admin>false</enableQueryDebug_Admin>
<enableQueryDebug_Super>false</enableQueryDebug_Super>
<autoRefreshInterval>60000</autoRefreshInterval>
<skipRedirectActions>false</skipRedirectActions>
<skipSubqueryDebugging>false</skipSubqueryDebugging>
<enableAdmin_Edit>true</enableAdmin_Edit>
<enableAdmin_Admin>false</enableAdmin_Admin>
<enableAdmin_Super>false</enableAdmin_Super>
<enableAJAX>false</enableAJAX>
<enableAJAXCustomPaging>false</enableAJAXCustomPaging>
<enableAJAXCustomStatus>false</enableAJAXCustomStatus>
<includeJavascriptUtilities>false</includeJavascriptUtilities>
<includeJavascriptValidation>false</includeJavascriptValidation>
<javascriptOnComplete />
<enableMultipleColumnSorting>false</enableMultipleColumnSorting>
<ModuleCommunicationMessageType />
<showAll>true</showAll>
<useExplicitSystemVariables>false</useExplicitSystemVariables>
<searchItems />
<queryItems>
<anyType xsi:type="QueryOptionItem">
<Index>0</Index>
<VariableType><Session></VariableType>
<QuerySource>vWhiteDate</QuerySource>
<QueryTarget>[MyDate]</QueryTarget>
<QueryTargetLeft>'</QueryTargetLeft>
<QueryTargetRight>'</QueryTargetRight>
<QueryTargetEmpty>'01/01/1901'</QueryTargetEmpty>
<Protected>true</Protected>
</anyType>
<anyType xsi:type="QueryOptionItem">
<Index>1</Index>
<VariableType><Session></VariableType>
<QuerySource>vWhiteShift</QuerySource>
<QueryTarget>[MyShift]</QueryTarget>
<QueryTargetLeft />
<QueryTargetRight />
<QueryTargetEmpty>0</QueryTargetEmpty>
<Protected>true</Protected>
</anyType>
</queryItems>
<listItems>
<anyType xsi:type="ListFormatItem">
<Index>0</Index>
<GroupStatement>Header / Footer</GroupStatement>
<ListHeader><script language=javascript>
var sGrid = [ModuleID,System]
</script>

<div align="Center"><font size="+3">Production Scoreboard</font>
<br>
<font size="+2">[FORMAT,[Time_stamp],{0:d}] &nbsp; Shift &nbsp; [shift]
</div>
<Table width=95%>
<tr bgcolor="LightSkyBlue" BorderWidth="1px" Font-Italic="False" Font-Bold="True">
<td width=40 align="Center">Time</td>
<td align="Center">West Comp. Seq.</td>
<td align="Center">West Track Seq.</td>
<td align="Center">Rear Function Seq.</td>
<td align="Center">Rear Match Seq.</td>
<td align="Center">West Comp. Build</td>
<td align="Center">West Track Build</td>
<td align="Center">Rear Function Build</td>
<td align="Center">Rear Match Build</td>
<td align="Center">BAP Loop</td>
<td align="Center">BAP Install</td>
<td align="Center">BAP Build</td>
</tr>
</ListHeader>
<ListFooter></Table></ListFooter>
</anyType>
</listItems>
<messageItems />
<query>EXEC ap_GET_WHITEBOARD [MyDate], [MyShift]</query>
<filter />
<customConnection />
<listItem>{IIF,[FORMAT,[Time_Stamp],{ISDATE}],"<tr>","<tr bgcolor=#CEFDFC>"}
<td width="100" align="Center"><font size="2">[Time_Stamp]</font></td>
<td align="Center"><font size="2">[foam_seq]</font></td>
<td align="Center"><font size="2">[slat_seq]</font></td>
<td align="Center"><font size="2">[Rear_Function]</font></td>
<td align="Center"><font size="2">[Rear_Seq]</font></td>
<td align="Center"><font size="2">[foam_Build]</font></td>
<td align="Center"><font size="2">[slat_Build]</font></td>
<td align="Center"><font size="2">[Function_Build]</font></td>
<td align="Center"><font size="2">[Rear_Build]</font></td>
<td align="Center"><font size="2">[BAP_Loop]</font></td>
<td align="Center"><font size="2">[Install]</font></td>
<td align="Center"><font size="2">[BAP_Build]</font></td>
</tr>
</listItem>
<listAItem />
<defaultItem><tr>
<td>
No Results Found
</td>
</tr></defaultItem>
<noqueryItem />
<Version>17</Version>
</xListSettings>
pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
28 Sep 2006 03:28 PM  
Now I'm intrigued.....that's wierd. BUT, I can not copy and paste your XML for some reason.

Export the XML file from the module menu and email it to me at pauldes at k p d s y s dot com
ListX....makes you look brilliant, even though you're not.
pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
28 Sep 2006 04:17 PM  
I'm pretty sure it's just bad HTML in your LIST section causing the container to display funny. I wasn't getting the same results as you but the EXCEL icon was displaying above the whole container.

In the header, you have a missing </font> tag before you close the first <div>
In your LIST No Result section, you don't have a table tag around the display. When there are no results, the header is not generated so your Header <table> and Footer </table> don't get processed. Add these tags to the top and bottom of the content in the LIST No Results field.

After I did that, it worked fine for me.
ListX....makes you look brilliant, even though you're not.
rdorrisUser is Offline
New Member
New Member
Posts:28

--
06 Oct 2006 05:39 PM  
I'm having the same kind of trouble. I have a container that displays the printer icon fine when it contains a text/html module. But when it contains a ListX module, it does not show the icon. The weird part is if I login as ADMIN to my dnn site, I DO see the printer icon. I've tried this on a number of ListX modules with the same problem. I've also looked thru my html to make sure it's valid. Any ideas? thanks.
kevinmschreinerUser is Offline
Advanced Member
Advanced Member
Posts:729

--
06 Oct 2006 06:08 PM  
Guys, I'm not sure if the Print option is techinically enabled for the module (its part of the definition). Just a few notes though. First - the easiest way of getting a printable UI is to change the response Output type (ACTIONUTPUT). This way the content will be delivered in standalone format. If you choose to do this, it is very important to verify the exact sources of your CSS. Because CSS will only be embedded if the URL is explicit (including the full http:\\ and domain name) when working with a copy of the content, you either need to manually include the CSS, or you can go through the process of creating inline STYLE tags to suffice.

Just on a side, because we have historically dodged the idea of using the Container logic to print - because there are many instances where one report is made up of multiple listX modules, we use a bit of logic in the skin to print the ENTIRE content pane. We do this by popping open a new window, which we then push all the content into, and then fire off the print request from there. The benefit? We can print the entire content pane, as well as include the CSS files manually within the content - all without doing anything special for any module. (Mostly because those silly print buttons all over the place looks bad).

Alright - so - Kevin.. How do we do that?

Here you go!

First - Create A file in the root of your website - called Report.html - with the following content:
------------------------------------------------------------
<HTML>
<HEAD>
<TITLE></TITLE>
<LINK id="_SL_Portals_0_" rel="stylesheet" type="text/css" href="/cgi-bin/Portals/0/portal.css"></LINK>
</HEAD>
<BODY BOTTOMMARGIN="0" LEFTMARGIN="0" TOPMARGIN="0" RIGHTMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">
<DIV id="TARGETDIV" name="TARGETDIV">
<!--CONTENTS OF REPORT GO HERE-->
</DIV>
</BODY>
</HTML>
------------------------------------------------------------

Next, you need to add the following script to your Skin (or to your page, depending on what you want to do. We always place this in the

------------------------------------------------------------
<script language=javascript>
var srcvalue = '';
var counter = 0;
var timer;
function printcontent(panename)
{
if (panename==null||panename=='')
panename = 'ContentPane'
myRef = window.open('/report.html','mywin','left=20,top=20,width=700,height=700,toolbar=1,resizable=1,scrollbars=yes');
srcvalue = document.getElementById('dnn_' + panename).innerHTML;
counter = 10;
waitfortarget();
}
function waitfortarget() {
counter--;
if (!myRef.document.getElementById('TARGETDIV'))
{
//DO NOTHING
if (counter > 0)
{
timer=setTimeout("waitfortarget()", 1000);
}
else
{
alert('Unable to load report. Please try again later.');
}
}
else
{
donetarget();
}
}
function donetarget()
{
myRef.document.getElementById('TARGETDIV').innerHTML = srcvalue;
myRef.print();
}
</script>
------------------------------------------------------------

Okay - so how do you print? All you need to do is execute the printcontent function - optionally specifying the name of the source pane.

<a href="javascript:printcontent('ContentPane');">Print</a>

kevinmschreinerUser is Offline
Advanced Member
Advanced Member
Posts:729

--
06 Oct 2006 06:10 PM  
Try it out live in our skin - right here!
--------------------------------------------------
Print
--------------------------------------------------
rdorrisUser is Offline
New Member
New Member
Posts:28

--
06 Oct 2006 06:27 PM  
Excellent! thanks for the help. However, one of your sentences got cut off: "We always place this in the ".... where do you normally place the script?
kevinmschreinerUser is Offline
Advanced Member
Advanced Member
Posts:729

--
06 Oct 2006 06:48 PM  
Skin. We place it in the skin, but you can place in within module headers or wherever.
jpolichnUser is Offline
New Member
New Member
Posts:34

--
10 Oct 2006 01:16 PM  
Thanks Kevin this does work.

But is there a reason why the print icon works if loged in as admin?
DavidWSnowUser is Offline
Basic Member
Basic Member
Posts:129

--
24 Dec 2006 08:46 PM  
Several Questions:
1. On my local host report.html needs to be in the web server's real root and not my DNN virtual root. I haven't tested this at my web ISP (GoDaddy) but only have access to the virtual root there. This also effects the css link

2. Second while you may wish to print multiple ListX module, there are times that I only want the current on. How do I do that.

3. Is there a way to print more than the currently display page of the report?
DavidWSnowUser is Offline
Basic Member
Basic Member
Posts:129

--
08 Jan 2007 05:32 PM  
I have set this method of printing up and it seems required if you are using ajax for selecting records for your grid, since the container's print seems to get the full record set and not just the ones that matching your query. It works ok on IE7.

However, it gets this error on FireFox 2.0

"document.getElementById("dnn_" + panename) has no properties"

The only tweak that I made to the report.html was to alter the link to where to find the css. The css is in my skin.
DavidWSnowUser is Offline
Basic Member
Basic Member
Posts:129

--
08 Jan 2007 07:42 PM  
A little more follow up. I happen to leave the FireFox error window open and when I came back it also included
Use of captureEvents() is deprecated, see bug 330494.
Use of releaseEvents() is deprecated, see bug 330494.
contactdpUser is Offline
Basic Member
Basic Member
Posts:475

--
08 Jan 2007 10:08 PM  
1. you should be able to put the script in your DNN virtual root. And alter the script little bit.

myRef = window.open('your site name/report.html'


2. Since this is going get the HTML from your current panes you can define multiple panes in your skin and call each module/ some modules independently.

Which version of DNN you are getting errors. Check the source HTML and find out what name it is returning for the actual panes... if it is different you will need to modify the script accordingly. I checked even in 44 it is dnn_PANENAME
Durga Prasad(DP) | Senior Web Engineer<br>R2integrated
DavidWSnowUser is Offline
Basic Member
Basic Member
Posts:129

--
11 Jan 2007 05:14 PM  
Answers:
1. I was hoping to not have to modify/write a skin. After all, one of the reasons that I bought ListX was so I didn't have to write a module. Not all of your customers want to become DNN developers. However, I suspect that I will make a multipane skin. Or hack your code to print one or maore containers.

2. I did tweek your code to find my skin.css and all works well on DNN 4.3.7 with IE7. With DNN 4.3.7, both on /localhost and GoDaddy using FireFox 2.0.0.1 with FireBug to display the JavaScript Console I get the error.

------------
One more question. Is there any way to force landscape mode when printing? I would design my report to be landcape mode and force that if I could.
You are not authorized to post a reply.
Page 1 of 3123 > >>


Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share