Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Automatically Printing Crystal Reports in ASP.NET


This server-based method is documented in the Visual Studio help files.  Open the Help Index, and enter PrintToPrinter in the "Look for:" box.  The syntax for this method is:
Report.PrintToPrinter(<copies as int>, <collated as True/False>, <startpage as int>, <endpage as int>)
'Collated' in this context has nothing to do with database collation.  Some advanced printers (like copier/printers) will sort each document into its own shelf.  Not every printer supports this functionality, so check the printer dialog before setting to true.  To print the entire report, set startpage and endpage each to 0. 
An example in use might look like
MyReport.PrintToPrinter(1,False,0,0)
One limitation of this method is that a printer name must be specified.  You can set the default printer at design time in the report, and you can change the printer name at run time by setting the ReportDocument.PrintOptions.PrinterName property (the PrintOptions are also where you can assign page margins, portrait/landscape, etc.).  Keep in mind that this method prints from the server itself, not from the client machine.  This means that any printer you wish to use must be accessible from the server.  You cannot print to a client's desktop printer using this method unless that printer is shared on the network and mapped to the server.
If your LAN has networked printers, you can make some guesses as to which printer to assign as the default in each report.  For instance, if the Accounting Department has a departmental printer, that would be a good choice to use for the default in an accounting report.  You can provide users the option to choose a networked printer by enumerating the printers mapped to the server and populating a drop-down list.  The PrinterSettings.InstalledPrinters property returns a collection of installed printers, and can be bound to a DropDownList as below.


Ïà¹ØÎĵµ£º

asp.net³¬Á´½Ó´«ÖµÎÊÌâ

×î½ü¿ª·¢ÖÐÔÚÒ³ÃæÖ®¼ä´«µÝÖµµÄ¹ý³ÌÖУ¬¶à´¦Ó¦ÓÃÁ˳¬Á´½Ó´«ÖµµÄ·½Ê½¡£µ«Êǵ±´«µÝµÄ²ÎÊýÖк¬ÓÐÖÐÎÄ×Ö·ûʱ£¬ÔÚµ÷ÓÃRequest.QueryString[]·½·¨½ÓÊÕ²ÎÊýʱ£¬×ÜÊdzöÏÖ´íÎ󣬶øÇÒ´íÎóµÄ³öÏÖ×ÜÊÇËæ»úµÄ¡£±íÏÖΪ½ÓÊÕµÄÖÐÎIJÎÊý²»È«£¬ºó¼ÓͨÅä·û“£¿”£¬»òÕß°ÑÖÐÎIJÎÊýºóµÄÄǸö²ÎÊýºÍÖÐÎIJÎÊý»ìÔÚÒ»Æ𣬲»¼ÓÇø·Ö¡£
 & ......

ASP.NET MVC ÈëÃÅ4¡¢ControllerÓëAction

±¾ÏµÁÐÎÄÕ»ùÓÚASP.NET MVC Preview5.
ControllerÊÇMVCÖбȽÏÖØÒªµÄÒ»²¿·Ö¡£¼¸ºõËùÓеÄÒµÎñÂß¼­¶¼ÊÇÔÚÕâÀï½øÐд¦ÀíµÄ£¬²¢ÇÒ´ÓModelÖÐÈ¡³öÊý¾Ý¡£ÔÚASP.NET
MVC
Preview5ÖУ¬½«Ô­À´µÄControllerÀàÒ»·ÖΪ¶þ£¬·ÖΪÁËControllerÀàºÍControllerBaseÀà¡£ControllerÀà
¼Ì³Ð×ÔControllerBaseÀ࣬¶øControllerBaseʵÏÖÊÇÁËICont ......

ASP.NET¿çÒ³Ãæ´«Öµ¼¼ÇÉ

¡¡¡¡½ñÌìTMȺÀïÓÐÈËÎÊÆð¹ØÓÚÒ³Ãæ´«ÖµµÄ·½·¨£¬ÓÖÒý·¢ÁËÒ»³¡ÌÖÂÛ¡£¿´À´Õâ¸ö»¹ÊÇÓкܶàÈ˹Ø×¢µÄ£¬Òò´ËÎÒ¾ÍÎÒ¸öÈ˹۵ã×öÁËЩ×ܽᣬϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
¡¡¡¡1.  ʹÓÃQueryString±äÁ¿
¡¡¡¡¡¡¡¡QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṠ......

ASP.NETÒ³Ãæ´«ÖµµÄ·½·¨


ÔÚÃæÊÔµÄʱºò£¬¾­³£»áÓöµ½ÕâÑùµÄÎÊÌ⣬ÆäʵÎÒÃÇ»á¶ÔÆäÖеļ¸ÖÖ·½·¨±È½ÏÊìϤ£¬ÒòΪÏîÄ¿Öо­³£Ê¹Óᣵ«ÊÇҪȫÃæµÄ»Ø´ðASP.NETÖÐÒ³Ãæ´«ÖµµÄ·½Ê½£¬¹À¼ÆÍùÍùºÜÄÑÈ«Ãæ¡£
Ò».
ʹÓÃQueryString±äÁ¿
¡¡¡¡¡¡¡¡QueryStringÊÇÒ»Öַdz£¼òµ¥Ò²ÊÇʹÓñȽ϶àµÄÒ»ÖÖ´«Öµ·½Ê½£¬µ«ÊÇËü½«´«µÝµÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖÐ,Èç¹ûÊÇ´«µÝÒ»¸ö»ò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ