jasperprint 利奥拉怎么获得得

14:44:11.0
Can you tryJasperViewer jrviewer = new JasperViewer(jasperPrint, false);instead ofJasperViewer jrviewer = new JasperViewer(jasperPrint);and see if it works?http://jasperreports.sourceforge.net/api/net/sf/jasperreports/view/JasperViewer.html#JasperViewer(net.sf.jasperreports.engine.JasperPrint,%20boolean)regards,karthikJacques Nogueira dos Santos wrote:&& && Hello, I&A&m having a problem with jrviewer.&& I have a form that let&A&s the user inform the values for the report. On & the action of the button has the following code:&& && .&& .&& .&& JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, & map,con); && JasperViewer jrviewer = new JasperViewer(jasperPrint); && jrviewer.setDefaultCloseOperation( DISPOSE_ON_CLOSE );&& jrviewer.setVisible(true);&& && && When I click on 'X' of the jrviewer, it&A&s close all the project. So I & used the DEBUG and on Local Variables/ jrviewer, the isExitClose has & value TRUE.&& && && What&A&s happening? What must I do so as to solve this problem? I want & the jrviwer just dispose on close, and the first Form continue & visible, not closing all the project.&& && && Thanks.&
23:13:14.0
You should call JasperViewer instance with following code.JasperViewer jasperViewer = new JasperViewer(jasperPrint, false);Because:============================================public JasperViewer(JasperPrint jasperPrint){this(jasperPrint, true);}public JasperViewer(JasperPrint jasperPrint, boolean isExitOnClose){this(jasperPrint, isExitOnClose, null);}============================================JasperViewer(JasperPrint jasperPrint) constructor calls JasperViewer with exit on close.
20:45:36.0
Thankyou so much karthik,I saw your codes its working so fine and fulfilled my requirement.regards,Rohit.
阅读(...) 评论()503 Service Temporarily Unavailable
Service Temporarily Unavailable
目前我们正在全力抢救中,喝杯咖啡回来继续畅游吧。当前位置: >
> 引用jaspersoft包来打印报表中获得jasperPrint错误
引用jaspersoft包来打印报表中获得jasperPrint错误
luyuhai007 & at
引用jaspersoft包来打印报表中获得jasperPrint异常在运行
jasperPrint&=&JasperFillManager.fillReport(report,&params,&connection);
语句之后控制台打印出一下信息。没有明显的exception信息,不知问题出在哪里。请大虾们帮忙看一下
&&context:&/pwms
&&delegate:&false
&&repositories:
&&&&/WEB-INF/classes/
----------$>$Parent&Classloader:
org.apache.catalina.loader.StandardClassLoader@c79809
15:50:36,250&DEBUG&JRLoader:692&-&Found&resource&jasperreports_extension.properties&at&jar:file:/E:/workingSoft/apache-tomcat-6.0.33/webapps/pwms/WEB-INF/lib/jasperreports-4.0.0.jar!/jasperreports_extension.properties&in&classloader&WebappClassLoader
&&context:&/pwms
&&delegate:&false
&&repositories:
&&&&/WEB-INF/classes/
----------$>$Parent&Classloader:
org.apache.catalina.loader.StandardClassLoader@c79809
15:50:36,265&DEBUG&JRLoader:692&-&Found&resource&jasperreports_extension.properties&at&jar:file:/E:/workingSoft/apache-tomcat-6.0.33/webapps/pwms/WEB-INF/lib/jasperreports-fonts-4.0.0.jar!/jasperreports_extension.properties&in&classloader&WebappClassLoader
&&context:&/pwms
&&delegate:&false
&&repositories:
&&&&/WEB-INF/classes/
----------$>$Parent&Classloader:
org.apache.catalina.loader.StandardClassLoader@c79809
15:50:36,265&DEBUG&JRLoader:692&-&Found&resource&jasperreports_extension.properties&at&jar:file:/E:/workingSoft/apache-tomcat-6.0.33/webapps/pwms/WEB-INF/lib/jasperreports-javaflow-4.0.0.jar!/jasperreports_extension.properties&in&classloader&WebappClassLoader
&&context:&/pwms
&&delegate:&false
&&repositories:
&&&&/WEB-INF/classes/
----------$>$Parent&Classloader:
org.apache.catalina.loader.StandardClassLoader@c79809
附:以下是
jasperPrint&=&JasperFillManager.fillReport(report,&params,&connection);中三个参数的情况。
求大虾关注!luyunjing & &
& & (0)(0)
本问题标题:
本问题地址:
温馨提示:本问题已经关闭,不能解答。
暂无合适的专家
&&&&&&&&&&&&&&&
希赛网 版权所有 & &&&&湘教QS2-164&&增值电信业务经营许可证湘B2-12285人阅读
在C#中获得文件信息很容易,只需要用FileInfo类或者FileVersionInfo类就可以获得,但是如果想要获得文件的扩展信息,则无法从这两类来获得。不过在C#中,这也不是件难事,只要引入&Microsoft Shell Controls and Automation&这个COM就可以获得。
接下来就分别来介绍。
首先介绍FileInfo类,这个类非常简单,首先需要根据文件名来创建FileInfo对象,例如:
using System.IO;
FileInfo fi = new FileInfo( yourFileName );
那么以后就可以通过此对象来访问文件一些属性,例如文件大小,创建时间,最后访问时间,最后写入时间等等,还可以通过访问对象的Attributes属性,来获得当前文件是只读、隐藏之类属性,这里我就不细说了,详情参看MSDN。
第二个要说的,就是FileSystemInfo类,这个类是FileInfo类的基类,这里也就不多说了。
第三个要说的,就是如何判断一个文件的Version信息,这就需要来介绍FileVersionInfo这个类。但是并不是所有的文件都有Version信息,因此在使用FileVersionInfo的时候需要注意的是,最好先判断一下文件的扩展名。不过一个FileVersionInfo类对象不能通过构造函数来创建,需要调用类的静态方法来获得,例如:
using System.D
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo( yourFileName );
通过此对象,可以获得文件的产品名称,公司名,版本号,语言版本,版权等等,这方面详情可以参看MSDN。
最后要说的,就是如何得到一个文件的扩展信息,例如标题,作者等等,这些信息从如上三个类中是无法获得。但是要在C#程序中获得,就需要引入一个&Microsoft Shell Controls and Automation&这个COM,这个COM是由系统&Shell32.dll&而提供。这方面的例子,可以参看如下这篇文章。
为了方便大家使用,我把其中类的代码贴出来。
using Shell32; // Use this namespace after add the reference
&&& /// &summary&
&&& /// Returns the detailed Information of a given file.
&&& /// &/summary&
&&& public class CFileInfo
&&&&&&& private string sFileName =&&,
&&&&&&&&&&& sFullFileName=&&,
&&&&&&&&&&& sFileExtension=&&,
&&&&&&&&&&& sFilePath = &&,
&&&&&&&&&&& sFileComment = &&,
&&&&&&&&&&& sFileAuthor = &&,
&&&&&&&&&&& sFileTitle = &&,
&&&&&&&&&&& sFileSubject = &&,
&&&&&&&&&&& sFileCategory = &&,
&&&&&&&&&&& sFileType = &&;
&&&&&&& private long lFileLength = 0,
&&&&&&&&&&& lFileVersion = 0;
&&&&&&& private DateTime dCreationDate,
&&&&&&&&&&& dModificationD
&&&&&&& public CFileInfo(string sFPath)
&&&&&&&&&&&
&&&&&&&&&&& // check if the given File exists
&&&&&&&&&&& if(File.Exists(sFPath))
&&&&&&&&&&& {
&&&&&&&&&&&&&&& ArrayList aDetailedInfo = new ArrayList();
&&&&&&&&&&&&&&& FileInfo oFInfo = new FileInfo(sFPath);
&&&&&&&&&&&&&&& sFileName = oFInfo.N
&&&&&&&&&&&&&&& sFullFileName = oFInfo.FullN
&&&&&&&&&&&&&&& sFileExtension = oFInfo.E
&&&&&&&&&&&&&&& lFileLength=oFInfo.L
&&&&&&&&&&&&&&& sFilePath = oFInfo.Directory.ToString();
&&&&&&&&&&&&&&& dCreationDate = oFInfo.CreationT
&&&&&&&&&&&&&&& dModificationDate = oFInfo.LastWriteT
&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&& #region &read File Details&
&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&& aDetailedInfo = GetDetailedFileInfo(sFPath);
&&&&&&&&&&&&&&& foreach(DetailedFileInfo oDFI in aDetailedInfo)
&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&& switch(oDFI.ID)
&&&&&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&&&&&& case 2:
&&&&&&&&&&&&&&&&&&&&&&&&&&& sFileType = oDFI.V
&&&&&&&&&&&&&&&&&&&&&&&&&&& break;
&&& &&&&&&&&&&&&&&&&&&& case 9:
&&&&&&&&&&&&&&&&&&&&&&&&&&& sFileAuthor = oDFI.V
&&&&&&&&&&&&&&&&&&&&&&&&&&& break;
&&&&&&&&&&&&&&&&&&&&&&& case 10:
&&&&&&&&&&&&&&&&&&&&&&&&&&& sFileTitle = oDFI.V
&&&&&&&&&&&&&&&&&&&&&&&&&&& break;
&&&&&&&&&&&&&&&&&&&&&&& case 11:
&&&&&&&&&&&&&&&&&&&&&&&&&&& sFileSubject = oDFI.V
&&&&&&&&&&&&&&&&&&&&&&&&&&& break;
&&&&&&&&&&&&&&&&&&&&&&& case 12:
&&&&&&&&&&&&&&&&&&&&&&&&&&& sFileCategory = oDFI.V
&&&&&&&&&&&&&&&&&&&&&&&&&&& break;
&&&&&&&&&&&&&&&&&&&&&&& case 14:
&&&&&&&&&&&&&&&&&&&&&&&&&&& sFileComment = oDFI.V
&&&&&&&&&&&&&&&&&&&&&&&&&&& break;
&&&&&&&&&&&&&&&&&&&&&&& default:
&&&&&&&&&&&&&&&&&&&&&&&&&&& break;
&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&& #endregion
&&&&&&&&&&& }
&&&&&&&&&&& else
&&&&&&&&&&& {
&&&&&&&&&&&&&&& throw new Exception(&The given File does not exist&);
&&&&&&&&&&& }
&&&&&&& #region &Properties&
&&&&&&& public string FileName
&&&&&&&&&&& get{return sFileN}
&&&&&&&&&&& set{sFileName=value;}
&&&&&&& public string FilePath
&&&&&&&&&&& get{return sFileP}
&&&&&&&&&&& set{sFilePath = value;}
&&&&&&& public string FullFileName
&&&&&&&&&&& get{return sFullFileN}
&&&&&&&&&&& set{sFullFileName=value;}
&&&&&&& public string FileExtension
&&&&&&&&&&& get{return sFileE}
&&&&&&&&&&& set{sFileExtension=value;}
&&&&&&& public long FileSize
&&&&&&&&&&& get{return lFileL}
&&&&&&&&&&& set{lFileLength=value;}
&&&&&&& public long FileVersion
&&&&&&&&&&& get{return lFileV}
&&&&&&&&&&& set{lFileVersion=value;}
&&&&&&& public DateTime FileCreationDate
&&&&&&&&&&& get{return dCreationD}
&&&&&&&&&&& set{dCreationDate=value;}
&&&&&&& public DateTime FileModificationDate
&&&&&&&&&&& get{return dModificationD}
&&&&&&&&&&& set{dModificationDate=value;}
&&&&&&& public string FileType
&&& &&&&&&& get{return sFileT}
&&&&&&& public string FileTitle
&&&&&&&&&&& get{return sFileT}
&&&&&&& public string FileSubject
&&&&&&&&&&& get{return sFileS}
&&&&&&& public string FileAuthor
&&&&&&&&&&& get{return sFileA}
&&&&&&& public string FileCategory
&&&&&&&&&&& get{return sFileC}
&&&&&&& public string FileComment
&&&&&&&&&&& get{return sFileC}
&&&&&&& #endregion
&&&&&&& #region &Methods&
&&&&&&& private ArrayList GetDetailedFileInfo(string sFile)
&&&&&&&&&&& ArrayList aReturn = new ArrayList();
&&&&&&&&&&& if(sFile.Length&0)
&&&&&&&&&&& {
&&&&&&&&&&&&&&& try
&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&& // Creating a ShellClass Object from the Shell32
&&&&&&&&&&&&&&&&&&& ShellClass sh = new ShellClass();
&&&&&&&&&&&&&&&&&&& // Creating a Folder Object from Folder that inculdes the File
&&&&&&&&&&&&&&&&&&& Folder dir = sh.NameSpace( Path.GetDirectoryName( sFile ) );
&&&&&&&&&&&&&&&&&&& // Creating a new FolderItem from Folder that includes the File
&&&&&&&&&&&&&&&&&&& FolderItem item = dir.ParseName( Path.GetFileName( sFile ) );
&&&&&&&&&&&&&&&&&&& // loop throw the Folder Items
&&&&&&&&&&&&&&&&&&& for( int i = 0; i & 30; i++ )
&&&&&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&&&&&& // read the current detail Info from the FolderItem Object
&&&&&&&&&&&&&&&&&&&&&&& //(Retrieves details about an item in a folder. For example, its size, type, or the time of its last modification.)
&&&&&&&&&&&&&&&&&&&&&&& // some examples:
&&&&&&&&&&&&&&&&&&&&&&& // 0 Retrieves the name of the item.
&&&&&&&&&&&&&&&&&&&&&&& // 1 Retrieves the size of the item.
&&&&&&&&&&&&&&&&&&&&&&& // 2 Retrieves the type of the item.
&&&&&&&&&&&&&&&&&&&&&&& // 3 Retrieves the date and time that the item was last modified.
&&&&&&&&&&&&&&&&&&&&&&& // 4 Retrieves the attributes of the item.
&&&&&&&&&&&&&&&&&&&&&&& // -1 Retrieves the info tip information for the item.
&&&&&&&&&&&&&&&&&&&&&&& string det = dir.GetDetailsOf( item, i );
&&&&&&&&&&&&&&&&&&&&&&& // Create a helper Object for holding the current Information
&&&&&&&&&&&&&&&&&&&&&&& // an put it into a ArrayList
&&&&&&&&&&&&&&&&&&&&&&& DetailedFileInfo oFileInfo = new DetailedFileInfo(i,det);
&&&&&&&&&&&&&&&&&&&&&&& aReturn.Add(oFileInfo);
&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&& catch(Exception)
&&& &&&&&&&&&&& {
&&&&&&&&&&&&&&& }
&&&&&&&&&&& }
&&&&&&&&&&& return aR
&&&&&&& #endregion
&&& // Helper Class from holding the detailed File Informations
&&& // of the System
&&& public class DetailedFileInfo
&&&&&&& int iID = 0;
&&&&&&& string sValue =&&;
&&&&&&& public int ID
&&&&&&&&&&& get{return iID;}
&&&&&&&&&&& set
&&&&&&& &&& {
&&&&&&&&&&&&&&& iID=value;
&&&&&&&&&&& }
&&&&&&& public string Value
&&&&&&&&&&& get{return sV}
&&&&&&&&&&& set{sValue = value;}
&&&&&&& public DetailedFileInfo(int ID, string Value)
&&&&&&&&&&& iID = ID;
&&&&&&&&&&& sValue = V
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:700062次
积分:7145
积分:7145
排名:第1020名
原创:87篇
评论:817条
(1)(3)(7)(3)(14)(5)(6)(11)(8)(30)经验内容仅供参考,如果您需解决具体问题(尤其法律、医学等领域),建议您详细咨询相关领域专业人士。
说说为什么给这篇经验投票吧!
我为什么投票...
你还可以输入500字
看了这篇经验,你有一些独到的心得要分享给大家?或是,你按照作者的指导,做出了一模一样,甚至更棒的结果?
不管是“有心得”,还是“有所得”,都快分享给经验的小伙伴们看看吧!
你还可以输入1000字
如对这篇经验有疑问,可反馈给作者,经验作者会尽力为您解决!
你还可以输入500字
请扫描分享到朋友圈

我要回帖

更多关于 狂野之血怎么获得 的文章

 

随机推荐