kiran raja

Greenhorn
+ Follow
since May 11, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by kiran raja

Hi,

I have a peculiar problem. After jasper creates report in excel format. I take the output file into POI and do some manupulations and save it back. when i open the report and print preview the sheets. The fonts appear in different colours. That is, the colour of fonts in my reports are black. But when i print preview the reports sheets, the font appears in blue or green or red . If i am using a black and white printer, Then print preview shows the font colour as white or light grey. Can any body help me to resolve this issue.



Thanks in advance,

Regards

Kiran
12 years ago

Hi ,

I have an requirement where my datasource contains lists of list,that is, i have created a list containing 3 lists. And each list values must be listed in 3 different sheets(there are about 9000+ records in each list). All the three sheets make use the same jrxml file. Is there a way that i can pass my datasource to JasperFillManager and it creates 3 sheets in one call.Please help.

I am presently, iterating the list and calling JasperFillManager to create 3 JasperPrint Objects. And then merging them into in one report by setting the JRExporterParameter.JASPER_PRINT_LIST parameter.This is taking a lot of memory, and in some instances goes out of memory. I need to avoid creating three jasperprint objects and the filling has to be done in one call so that i have only one jasper print object to export.

Thanks,
Kiran
Hi ,

I have an requirement where my datasource contains lists of list,that is, i have created a list containing 3 lists. And each list values must be listed in 3 different sheets(there are about 9000+ records in each list). All the three sheets make use the same jrxml file. Is there a way that i can pass my datasource to JasperFillManager and it creates 3 sheets in one call.

I am presently, iterating the list and calling JasperFillManagert to create 3 JasperPrint Objects. And then merging them into in one report by setting the JRExporterParameter.JASPER_PRINT_LIST parameter.This is taking a lot of memory, and in some instances goes out of memory. I need to avoid creating three jasperprint objects and the filling has to be done in one call so that i have only one jasper print object to export.

Please help.

Thanks,
Kiran
Hi ,

I tested the methos posted by "dave taubler" and found that the specialValue mentioned "x", would not serve the purpose. Which means if i have a value x that verfies to true, then the entire table rows will be bolded. Instead only custom renderer could be used to serve the purpose. Suppose based on the column cell value at position 4,we can decide whether the whole row field should be bolded or not. Check out the custom cell renderer below;



Cheers
Kiran
13 years ago
Hi ,

I tested the methos posted by "dave taubler" and found that the specialValue mentioned "x", would not serve the purpose. Which means if i have a value x that verfies to true, then the entire table rows will be bolded. Instead only custom renderer could be used to serve the purpose. Suppose based on the column cell value at position 4,we can decide whether the whole row field should be bolded or not. Check out the custom cell renderer below;



Cheers
Kiran
13 years ago
Run the screen update in synchronized thread.

Cheers
Kiran
14 years ago
[ Free homework solution deleted. Sorry, I'm a little late, it seems.]
[ June 06, 2006: Message edited by: Ernest Friedman-Hill ]
16 years ago
Hello ,
I am developing a application using java language. In my project i am using openPGP "Bouncy Castle Crypto API" for PGP cryptographic operations. I am using keyring file to encypt or decrypt files in my application.But If I try to use a DH/DSS keypair , I get an error message saying :

org.bouncycastle.openpgp.PGPException: unknown parameters or keysize

I am not able to PGPencryt or PGPdecrypt using DH/DSS key pair.
Does "Bouncy Castle Crypto API" support DH/DSS algorithm ?? or
Are there any other packages that supports both RSA as well as DH/DSS encryption and decrytion .

please suggest.This is a very urgent requirement.

Thanks in advance,
Kiran
17 years ago
Hello ,
I am developing a application using java language. In my project i am using openPGP "Bouncy Castle Crypto API" for PGP cryptographic operations. I am using keyring file to encypt or decrypt files in my application.But If I try to use a DH/DSS keypair , I get an error message saying :

org.bouncycastle.openpgp.PGPException: unknown parameters or keysize

I am not able to PGPencryt or PGPdecrypt using DH/DSS key pair.
Does "Bouncy Castle Crypto API" support DH/DSS algorithm ?? or
Are there any other packages that supports both RSA as well as DH/DSS encryption and decrytion .

please suggest.This is a very urgent requirement.

Thanks in advance,
Kiran
17 years ago
Hello ,
I am developing a application using java language. In my project i am using openPGP "Bouncy Castle Crypto API" forPGP cryptographic operations. I am using keyring file to encypt or decrypt files in my application.But If I try to use a DH/DSS keypair , I get an error message saying :

org.bouncycastle.openpgp.PGPException: unknown parameters or keysize

I am not able to PGPencryt or PGPdecrypt using DH/DSS key pair.
Does "Bouncy Castle Crypto API" support DH/DSS algorithm ?? or
Are there any other packages that supports both RSA as well as DH/DSS encryption and decrytion .

please suggest.This is a very urgent requirement.

Thanks in advance,
Kiran
17 years ago
Hi,
I beleive its better you remove the scroll pane that you have added as the root container. I mean remove the scrollpane before adding mainPanel .

cheers
Kiran
17 years ago
Hi
the method to set frame Icon is :

frame.setFrameIcon(new ImageIcon(image));

call this method in the constructor.


-Kiran
17 years ago
This is the custom Dialog i have used in my program.....


-Kiran


17 years ago
Hi Smriti,
I am giving you an example program.I have tried to reproduce your problem.This program is working fine on my system. With this i hope all your problems come to an end.

Wishing you all Success.

With regards ,
Kiran

17 years ago
Hi Smriti,
I am giving you an example program.I have tried to reproduce your problem.This program is working fine on my system. With this i hope all your problems come to an end.

Wishing you all Success.

With regards ,
Kiran


import java.awt.*;
import java.awt.event.*;
import java.text.*;// NEW
import java.util.*;

import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.swing.text.*;// NEW

import dl.*;

public class TextDemo extends JFrame {
protected JFormattedTextField m_firstTxt;// NEW
protected JFormattedTextField m_lastTxt;
protected JFormattedTextField m_phoneTxt;
protected JFormattedTextField m_faxTxt;
protected JPasswordField m_passwordTxt;
protected JTextArea m_commentsTxt;// NEW
protected JLabel m_status;

public static final String PHONE_PATTERN = "(###)###-####";

public TextDemo() {
super("Text Components Demo");
Font monospaced = new Font("Monospaced", Font.PLAIN, 12);
JPanel pp = new JPanel(new BorderLayout());

JPanel p = new JPanel(new DialogLayout2());
p.setBorder(new EmptyBorder(10, 10, 10, 10));
p.add(new JLabel("First name:"));
m_firstTxt = new JFormattedTextField(
new NameFormat());// NEW
m_firstTxt.setInputVerifier(new TextVerifier(
"First name cannot be empty"));
m_firstTxt.setColumns(12);
p.add(m_firstTxt);

p.add(new JLabel("Last name:"));
m_lastTxt = new JFormattedTextField(
new NameFormat());// NEW
m_lastTxt.setColumns(12);
p.add(m_lastTxt);

p.add(new JLabel("Phone number:"));// NEW
MaskFormatter formatter = null;
try {
formatter = new MaskFormatter(PHONE_PATTERN);
}
catch (ParseException pex) {
pex.printStackTrace();
}
m_phoneTxt = new JFormattedTextField(formatter);
m_phoneTxt.setColumns(12);
m_phoneTxt.setInputVerifier(new FTFVerifier(
"Phone format is "+PHONE_PATTERN));
p.add(m_phoneTxt);

p.add(new JLabel("Fax number:"));// NEW
m_faxTxt = new JFormattedTextField(
new PhoneFormat());
m_faxTxt.setColumns(12);
m_faxTxt.setInputVerifier(new FTFVerifier(
"Fax format is "+PHONE_PATTERN));
p.add(m_faxTxt);

p.add(new JLabel("Login password:"));
m_passwordTxt = new JPasswordField(20);
m_passwordTxt.setFont(monospaced);
m_passwordTxt.setInputVerifier(new TextVerifier(
"Login password cannot be empty"));
p.add(m_passwordTxt);

p.setBorder(new CompoundBorder(
new TitledBorder(new EtchedBorder(), "Personal Data"),
new EmptyBorder(1, 5, 3, 5))
);
pp.add(p, BorderLayout.NORTH);

m_commentsTxt = new JTextArea("", 4, 30);
m_commentsTxt.setFont(monospaced);
m_commentsTxt.setLineWrap(true);
m_commentsTxt.setWrapStyleWord(true);
p = new JPanel(new BorderLayout());
p.add(new JScrollPane(m_commentsTxt));
p.setBorder(new CompoundBorder(
new TitledBorder(new EtchedBorder(), "Comments"),
new EmptyBorder(3, 5, 3, 5))
);
pp.add(p, BorderLayout.CENTER);

m_status = new JLabel("Input data");
m_status.setBorder(new CompoundBorder(
new EmptyBorder(2, 2, 2, 2),
new SoftBevelBorder(SoftBevelBorder.LOWERED)));
pp.add(m_status, BorderLayout.SOUTH);
Dimension d = m_status.getPreferredSize();
m_status.setPreferredSize(new Dimension(150, d.height));

pp.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(pp);
pack();
}

public static void main(String[] args) {
JFrame frame = new TextDemo();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}

/**
* Format which capitalize all words
*/
class NameFormat extends Format {

public StringBuffer format(Object obj, StringBuffer toAppendTo,
FieldPosition fieldPosition) {
fieldPosition.setBeginIndex(toAppendTo.length());
String str = obj.toString();
char prevCh = ' ';
for (int k=0; k<str.length(); k++) {
char nextCh = str.charAt(k);
if (Character.isLetter(nextCh) && prevCh == ' ')
nextCh = Character.toTitleCase(nextCh);
toAppendTo.append(nextCh);
prevCh = nextCh;
}
fieldPosition.setEndIndex(toAppendTo.length());
return toAppendTo;
}

public Object parseObject(String text, ParsePosition pos) {
pos.setIndex(pos.getIndex()+text.length());
return text;
}
}

/**
* Format phone numbers
*/
class PhoneFormat extends Format {

public StringBuffer format(Object obj, StringBuffer toAppendTo,
FieldPosition fieldPosition) {
fieldPosition.setBeginIndex(toAppendTo.length());

// Gen digits of the number
String str = obj.toString();
StringBuffer number = new StringBuffer();
for (int k=0; k<str.length(); k++) {
char nextCh = str.charAt(k);
if (Character.isDigit(nextCh))
number.append(nextCh);
else if (Character.isLetter(nextCh)) {
nextCh = Character.toUpperCase(nextCh);
switch (nextCh) {
case 'A':
case 'B':
case 'C':
number.append('2');
break;
case 'D':
case 'E':
case 'F':
number.append('3');
break;
case 'G':
case 'H':
case 'I':
number.append('4');
break;
case 'J':
case 'K':
case 'L':
number.append('5');
break;
case 'M':
case 'N':
case 'O':
number.append('6');
break;
case 'P':
case 'Q':
case 'R':
case 'S':
number.append('7');
break;
case 'T':
case 'U':
case 'V':
number.append('8');
break;
case 'W':
case 'X':
case 'Y':
case 'Z':
number.append('9');
break;
}
}
}

// Format digits according to the pattern
int index = 0;
for (int k=0; k<PHONE_PATTERN.length(); k++) {
char ch = PHONE_PATTERN.charAt(k);
if (ch == '#') {
if (index >= number.length())
break;
toAppendTo.append(number.charAt(index++));
}
else
toAppendTo.append(ch);
}

fieldPosition.setEndIndex(toAppendTo.length());
return toAppendTo;
}

public Object parseObject(String text, ParsePosition pos) {
pos.setIndex(pos.getIndex()+text.length());
return text;
}
}

/**
* Verify input to JTextField
*/
class TextVerifier extends InputVerifier {
private String m_errMsg;

public TextVerifier(String errMsg) {
m_errMsg = errMsg;
}

public boolean verify(JComponent input) {
m_status.setText("");
if (!(input instanceof JTextField))
return true;
JTextField txt = (JTextField)input;
String str = txt.getText();
if (str.length() == 0) {
m_status.setText(m_errMsg);
return false;
}
return true;
}
}

/**
* Verify input to JFormattedTextField
*/
class FTFVerifier extends InputVerifier {
private String m_errMsg;

public FTFVerifier(String errMsg) {
m_errMsg = errMsg;
}

public boolean verify(JComponent input) {
m_status.setText("");
if (!(input instanceof JFormattedTextField))
return true;
JFormattedTextField ftf = (JFormattedTextField)input;
JFormattedTextField.AbstractFormatter formatter =
ftf.getFormatter();
if (formatter == null)
return true;
try {
formatter.stringToValue(ftf.getText());
return true;
}
catch (ParseException pe) {
m_status.setText(m_errMsg);
return false;
}
}
}
}
17 years ago