Jsp code for report in text or pdf
How to generate report in either text or pdf format from jsp page?
How do you want to generate report?
For pdf you can use itext(http://www.lowagie.com/iText/)..
Similar Messages
-
This is my Jsp code for image upload in database:
This is my Jsp code for image upload in database:
-----------Upload.jsp----------------
<html>
<head>
</head>
<body bgproperties="fixed" bgcolor="#CCFFFF">
<form method="POST" action="UploadPicture.jsp" enctype="multiform/form-data">
<%! int update=0; %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.sql.Date" %>
<%@ page import="java.io.*"%>
<%@ page language = "java" %>
<%
try
String ct="3";
String path;
File image=new File(request.getParameter("upload"));
path=request.getParameter("upload");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:itPlusElectronics","","");
PreparedStatement pstmt=con.prepareStatement("insert into graphics values(?,?,?)");
pstmt.setString(2,path);
pstmt.setString(3,ct);
InputStream is=new FileInputStream(path);
pstmt.setBinaryStream(1, is, (int)(image.length()));
int s=pstmt.executeUpdate();
if(s>0)
out.println("Uploaded");
else
%>
unsucessfull
<%}
is.close();
pstmt.close();
catch(Exception e)
}%>
</p>
<p><br>
<img src="UploadedPicture.jsp">image</img>
<p></p>
</form>
</body>
</html>
My database name is itPlusElectronics and the table name is "graphics".
I have seen as a result of the above code that the image is stored in database as "Long binary data". and database table is look like as follows-------
picture path id
Long binary data D:\AMRIT\1-1-Picture.jpg 3
To retrive and display i use this JSP code as--
------------------------UploadedPicture.jsp------------------------------
<html>
<head>
</head>
<body bgproperties="fixed" bgcolor="#CCFFFF">
<%! int update=0; %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.io.*"%>
<%@ page language = "java" %>
<%@page import="javax.servlet.ServletOutputStream"%>
<%
try
String path;
path=request.getParameter("upload1");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:itPlusElectronics","","");
PreparedStatement pst = con.prepareStatement("SELECT * FROM graphics WHERE id ='3'");
// pst.setString(3, id);
ResultSet rs = pst.executeQuery();
path=rs.getString("path");
if(rs.next()) {
byte[] bytearray = new byte[4096];
int size=0;
InputStream sImage;
sImage = rs.getBinaryStream(1);
response.reset();
response.setContentType("image/jpeg");
response.addHeader("Content-Disposition","filename=path");
while((size=sImage.read(bytearray))!= -1 )
response.getOutputStream().write(bytearray,0,size) ;
response.flushBuffer();
sImage.close();
rs.close();
catch(Exception e)
%>
</body>
</html>
Now after browsing a jpg image file from client side and pressing submit button ;
I am unable display the image in the Upload.jsp file.Though I use
<img src="UploadedPicture.jsp">image</img> HTML code in Upload.jsp
file .
Now I am unable to find out the mistakes which is needed for displaying the picture in the Upload.jsp page..
If any one can help with the proper jsp code to retrive and display the image ,please please help me !!!!!!!!!!!!!!!!!!!!!!!!!!dketcham wrote:
cotton.m wrote:
>
2) I'm looking at how you called stuff, and you're trying to call the jsp file as an image? That jsp isn't the source of the image, just a page linking to an image. I think if you really want to do things that way you're going to need to just include that jsp within the jsp you're calling it from (or you can do it the easy way, and if you have the information to get the path of the image you want, you could simply call the image from the first jsp you posted)This is incorrect.
There are two JSPs. The second when called will (if it worked) return the source of an image as stored in the database.even when called with <img src=xx.jsp>??
Yes.
If any of what I say next seems obvious or otherwise negative I apologize, just trying to explain and I don't know what you know vs what you don't.
The link in the src is just a URL not a filetype. So just because it ends with JSP does not mean it has to return HTML. The content type is determined by the browser using the Content-Type header returned by the server in the HTTP response. In this case the header is set to be a jpeg so that's what the browser will attempt to interpret the content part of the response as.
So in fact one is not limited to just HTML or images but whatever content type you would like to return (that the browser can understand anyway). This could be HTML or it could be an image of some type or it could be a PDF or it could be an Excel spreadsheet. All you have to do in the JSP is set the header appropriately and then send content that is actually in that format.
This does not just apply to JSP by the way but all other web programming languages. You can do similar things to produce the same results in PHP, Perl, ASP etc.
The only JSP/Servlet complication is whether or not doing this in a JSP is a "good" idea but I am not an expert enough at that to make a definitive statement. Mostly though JDBC in a JSP is a no-no. -
Assign Transaction Code for Report Painter generated program
I am trying to assign a transaction code for report painter generated program... I assigned the transaction code in Development for the generated program but the program name changes in every system and I get a runtime error...
Can you please guide me on how to handle this problemhttp://dap-consulting.com/yahoo_site_admin/assets/docs/Report_Painter_Reports.47142031.pdf
Found my answer in the above link -
Custom T codes for Report painter in FI
Hi All -
I have list of report painter reports (created thru GR31) and need to create custom transaction codes. I need information for following points:
1. How to create tcodes for report painter report
2. We have to transport those tcodes from DEV server to production and client numbers are different, will the transaction codes work when we promote to different server.
Thanks in advance.
Rds,
KHi,
Following are the Answers to your Queries.
1. Please refer to [Creating Transaction Code For Report Painter Reports|http://www.google.com/url?sa=t&source=web&ct=res&cd=1&ved=0CAgQFjAA&url=http%3A%2F%2Fdap-consulting.com%2Fyahoo_site_admin%2Fassets%2Fdocs%2FReport_Painter_Reports.47142031.pdf&ei=MiWYS5ilCYeOlAfn4pCGDQ&usg=AFQjCNEZ0YO6vJ97K24MbU_NI5ROTb5vJA&sig2=Ke-svnqddqrz8RMcTuEnaw].
2. Please refer to 5th chapter (Page 90) of this document for [Transporting the Report Painter Reports|http://www.google.com/url?sa=t&source=web&ct=res&cd=3&ved=0CA0QFjAC&url=http%3A%2F%2Fwww.sapficoconsultant.com%2FBonus%2FReport%2520painter.pdf&ei=UiaYS8WOA5KylAei3830DA&usg=AFQjCNEHYqOFUd4XmZeX0JFt80OS-u7-mQ&sig2=dz40ldGpk_iyIRFR-yIxug].
Hope this helps.
Regards,
Chandravadan -
JSP codes for running a JAVA program
hello...
does anyone know the JSP codes for running a Java program from my web page?? i mean i already have my java program compiled... and i just want this java program to run in the background when I click on a button or a link...
Any idea about this?
plz advice..
aviyes... u r somewhat right... but this runs on Jakarta Tomcat...
i'm using the Apache Http Server together with the ServletExec AS which enable the Apache server to run JSP..
I've created a package where i've put my classes...
WEB-INF/classes/tbd(package name)/my classes
and i've added.. package name.. in my java program..
and then in jsp... i've written..
<%@ page import="tdb.*"%>
<jsp:useBean id="exec" class="tdb.textdb" />
<%exec.convert_data();%>
but when i run the page it says the package does not exist...
can anyone tell where to place the folder WEB-INF so that it can run fine?
thx
avi -
Hi All,
I am new to SAP area. I have created ABAP program (Report and variant) which generate list of materials. User would like to run whenever they want and have little knowledge of SAP. So I would like to provide Transaction code for this report to user. Can anyone let me know how to create transaction code for report. Also suggest, if any other option available to provide the same to user.Hi Yogesh,
Just as an option, you necessarily dont need to create a transaction so that the user can run the report. You can include the report in the menu for the user within his role to which he is assigned.
Hence on SAP easy access screen when he logs in, the user would be able to see the report all he needs to do is double click.
Just an option for you.
Regards,
Aditya
p.s. Transaction for role maintenance is PFCG .... refer to your basis consultant for more information -
Hello,
In Administration -> Setup -> Business Partners -> Countries there is a field called 'Code for Reports'. Does anyone know what this field is for? I thought it was for possibly putting in a different variation of the country code, e.g UK instead of GB to be displayed on printouts however it is not being displayed when i print preview/print.
Any advice is appreciated.
Many thanks,
KateHi Gordon,
I've tried displaying code on the print layout too but this does not get pulled through either. I would like to use the 'code for reports' field to display 'UAE' instead of 'AE'. 'AE' is the default country code for United Arab Emirates which cannot be changed however the users would like to see 'UAE' instead.
Kind regards,
Kate -
Jsp code for image compression
Hai,sir this is surendra i am doing a project using jsp and mysql.
In that each user can put his image and i am storing that image in mysql blob but that results to that database size.
So i need jsp code for image compression or another way for storing images.There's no need to store images in db. You may store them in a dedicated folder.
-
T-code for Report painter.
Hi
can anyone tell me, Is there any transaction code for report painter or it is an external tool.??
Thanks
UtpalHi,
Please check this transaction codes.
GR31/32/33 - Create/Change/Display Report
GR51/52/53 - Create/Change/Display Report Group
Regards,
Ferry Lianto -
Create t.code for report painter in CO-PA
Dear experts!
Now, I'm getting some issue about creating t.code for report painter in CO-PA.
Really, I don't know to create t.code for report painter that is created and run in t.code KE30.
Help me to solve the issue!
Best regards, HuyDear Huy,
To create a tcode for report created on the KE30:
1 - Get the parameters from your Z report, on table TKEB2 (on field REPID)
2 - On the SE93 create your tcode with option "Transaction with parameters"
2.1 - On the field "Transaction" fill with START_REPORT
2.2 - Choose the option "Skip inicial screen" and "Inherit GUI attibutes"
2.3 - On "Default Values" use the follow parameters:
D_SREPOVARI-REPORTTYPE <RE>
D_SREPOVARI-REPORT <NULL>
D_SREPOVARI-EXTDREPORT <APPCLASS SUBCLASS+TABNAME REPID>
*This information you got in table TKEB2, eg:
KE 01CE1CPFL ZDREB01
I hope the information has been useful,
Regards,
Melina -
Create T.Code for Report painter- report (GRR1)
Hi Experts,
I have created report in report painter( T.code - GRR1) using 1vk library, now i want to have a transaction code for my new report.
So, How can i create a T.code for customized report in GRR1.
Thanks
RajDear Raj,
Hope this link will help you.
http://home4sap.com/Blog/2009/08/how-to-create-a-transaction-code-for-report-painter-reports/
Thanks and regards
Praveen.J -
Code for report for "Serbia Montenegro"
Hi,
I need to create a new country from business partner master data for "Serbia - Montenegro". I create one ... but I don't know the "Code For Report" of "Serbia - Montenegro"
http://i1.tinypic.com/nd28np.gif
http://i1.tinypic.com/nd26ux.gif
Thank you for attention.Have you got news ?
I'm not a SAP BP for B/1.
Regards.
>Sorry, but I didn't want to open the GIFs...
>Re your question: OK, then I have no clue.
>I propose to ask that question in the SAP Business One >Forum in the Channel Partner Solution Network (CPSN) - >unless you get an answer soon. -
Hi ,
Please let me know the t code for report designer.
Regards
siddarthaHi
There is no direct Tcode to Query Designer / Report Designer .. You need to go Start -- Programs -- Bex
You can use Tcode RRMX to reach Query Analyzer. -
T. code for report (Report to Monitor Credit Limit Vs Outstanding)
Please send me in ECC 6.0 T. code for report (Report to Monitor Credit Limit Vs Outstanding)
Try any of these report using se38 for credit limit check.
RFDKLI30 Credit Limit Overvie
RFDKLI40 Credit Overview
RFDKLI41 Credit Master Sheet (complete details)
RFDKLIAB Display Changes to Credit Management
RFDKLI43 Credit Management: Master Data List (credit exposure limit)
anya -
Creating T-Code for Report in Report Painter
Hi Experts,
I need to create a T-Code for a report Z22KST2 in transaction CJE0 under the report type 001.Please suggest.
Thanks in advance.
Anand patilHi
Go to SE93
enter the TCODE you wants to create for this report painter report
Select the PARAMETER trasaction radiobutton.
Enter the description and transaction as START_REPORT
enter the REPORT TYPE and REPORT in the down
D_SREPOVARI-REPORTTYPE = < Report Group>
D_SREPOVARI-REPORT = <report>
Check this -
For Report Painter
http://help.sap.com/saphelp_47x200/helpdata/en/66/bc7d2543c211d182b30000e829fbfe/content.htm
http://searchsap.techtarget.com/searchSAP/downloads/Teach_yourself_SAP_C20.pdf#search=%22CREATE%20REPORT%20USING%20SQVI%20%2C%20SAP%22
Re: Interactive ALV
Reward points if useful
Regards
Anji
Maybe you are looking for
-
Problem in creation table for sap 4.6
hello evrybody i have just a problem in creating table with se11;after saving and activite those table and zhen i select icon of contents it bloocks and shoz this error message : Error reading table TMCNV; RC = 4 Message no. BMG 135 thank you for y
-
Error when displaying 2 DVT Graph in same page
Hi, I am using jdev 11g. I have a sample page with 2 graph on it. When the page is displayed only one graph is shown. <af:form> <dvt:graph id="p102" binding="#{TestManagerBean.myGraph}" graphType="#{TestManagerBean.graphType}" threeDEffect="true" sho
-
Use xlsm Format in SharePoint 2010?
I have a excel document with xlsm format (Excel Macro-Enabled Workbook, excel document containing VBA source code) and I wonder if I can upload it into SharePoint 2010 enterprise to display the powerpivot graph and of course use VBA code in Excel Ser
-
Hi ... i'm facing a problem while uploading any applciation into weblogic server.. this is the error it gives <Jul 26, 2006 11:48:39 AM MDT> <Error> <J2EE Deployment SPI> <BEA-260101> <Parameter may not be null. java.lang.NullPointerException at webl
-
I am using Stateless session bean. Can I cache the reference of the remote objects to this bean ? I read that some containers support the fearture of pre creating the EJB objects in the pool , during startup using some custom configuration ( like con