在Android上运行和打印报告 [英] Run and print reports at android

查看:126
本文介绍了在Android上运行和打印报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个应用程序,我想运行和打印报告(如Crystal Reports在.NET)。什么是做到这一点的最简单的方法?为了更具体的我创建的用户将在他的客户创建的发票和蓝牙打印机打印出来的应用程序。有没有像Android的水晶报表没有简单的方法?我试图使用Eclipse的水晶报表,但库并没有在Android上正常工作(至少我不知道如何)。

I create an application and I want to run and print reports (like crystal reports to at .net). What is the easiest way to do that? To be more specific I create an application that user will create invoices at his customers and print them at a bluetooth printer. Is there any easy way like crystal reports for android? I tried to use crystal reports for eclipse but the libraries does not work on android (at least I do not know how to).

推荐答案

首先,Android有没有内置或本地打印功能,只是因为Android有没有什么打印机的概念。

First off, Android has no built-in or native printing capabilities simply because Android has no concept of what printers are.

不过,您可以使用第三方库。

However, you can use third party libraries.

要正确地回答你的问题,你必须指定你打算用你的应用程序支持的Andr​​oid版本。由于一些不同的第三方库只支持某些Android版本。

To answer your question properly, you will have to specify which versions of Android you plan to support with your application. Because some of the various third party libraries only support certain versions of Android.

在除了包括第三方应用程序中的打印库,你可以发送一个广播意图的数据,你想打印,并根据安装在用户设备上的哪些应用程序,用户可以选择一个应用程序支持打印数据,你的意图发送的类型。

In addition to including a third party printing library in your application, you can send out a broadcast intent with the data you would like printed, and depending on what applications are installed on the users' device, the user could select an app that supports printing the type of data you send in the intent.

您也可以使用谷歌的新的云打印服务。这将是我的preferable选择,但实际打印到物理打印机用户将需要一个台式电脑,服务器,或Mac,要么已经连接了打印机或已安装并配置了网络功能的打印机。在这一点上,这可能是你最好的选择。

You could also use Google's new Cloud Printing service. This would be my preferable choice, but to actually print to a physical printer the user will need a desktop pc, server, or Mac that either has a printer connected to it or has a network capable printer installed and configured. At this point, this is probably your best bet.

这实在是一个困难的问题,解决的几个原因。首先,你需要弄清楚你要打印的内容,你需要它可以打印方式格式(PDF,PostScript或ASCII将仅举几例)。接下来,您将必须搞清楚,如果你要支持打印那些不具有蓝牙功能的打印机,所以如果你打算支持打印到网络功能的打印机,你将不得不在同一个LAN / VLAN作为WLAN该Android设备连接到和AP隔离需要被禁用。如果您打算支持Windows共享打印机,Mac OS X中的Bonjour打印机共享,或者零配置Linux打印机共享,那么你要么需要找到支持库和实施的方法来搜索各种网络共享,然后一个方式来选择和存储其中网络共享打印到。

This is really a difficult issue to tackle for a few reasons. First, you will need to figure out what you're going to print, you will need to format it in a way that can be printed (PDF, PostScript, or ASCII would name a few). Next you will have to figure out if you're going to support printing to printers that are not Bluetooth capable, so if you plan to support printing to a network capable printer, you will have to be on the same LAN/VLAN as the WLAN that the Android device is connected to and AP isolation will need to be disabled. If you plan to support shared Windows printer, Mac OS X Bonjour printer shares, or Zeroconf Linux printer shares then you will need to either find supporting libraries and implement a way to search for the various network shares and then a way to select and store which network share to print to.

既然你打算支持打印到具有蓝牙功能的打印机;然后有几个冰淇淋三明治和蜂窝分派能够与蓝牙打印机配对(Android的版本将需要3.0或3.1以上版本[我不能完全肯定在那个蓝牙打印协议得以实施的蜂窝SDK什么级别]和4.0.3+)。作为实际格式化数据要被打印在蓝牙,我不能确定使用哪些可以打印,哪些蓝牙版本或协议。我会做一些进一步的研究今天上午我会后回来的信息,我可以拿出。

Since you plan to support printing to Bluetooth capable printers; then there are a few Ice Cream Sandwich and Honeycomb distributions which are capable of pairing with Bluetooth printers (the Android versions would need to be 3.0 or 3.1+ [I am not completely sure at what SDK level for Honeycomb that Bluetooth printing protocols were implemented] and 4.0.3+). As for actually formatting the data to be printed over Bluetooth, I am unsure what can be printed and what Bluetooth versions or protocols are used. I will do some further research this morning and I will post back with the information I can come up with.

这篇关于在Android上运行和打印报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆