How to generate jsreport pdf reports from react-native?
-
Hi,
Is it possible to generate jsreport pdf reports from react native?. We have used
jsreport-browser-client-dist but it is not working.Also how to display the generated pdf reports using react-native-view-pdf (Library for displaying PDF documents in react-native).Could you please reply with an example?
-
hi!
Is it possible to generate jsreport pdf reports from react native?
I think it is possible, however, we don't have any example for it at the moment.
We have used
jsreport-browser-client-dist but it is not workingi guess it does not work by default because it is browser-oriented, but the
.renderAsync
api should probably work, even if it does not work (maybe because react-native does not haveXMLHttpRequest
) you can easily replicate the http request usingfetch
, it is just an http request after all.Also how to display the generated pdf reports using react-native-view-pdf
it depends on the type of input the react-native-view-pdf lib expects the pdf to be, i see it accepts base64 string too, probably the easiest is that you call fetch replicating the http request we do, and then with the response convert it to base64 and pass it as input of react-native-view-pdf
sorry if we don't provide you an example, we don't have a RN env ready, and prepare one will take some time, but we will keep in mind to increase the number of examples in other platforms in the future