Skip to Content
0
Former Member
Apr 21, 2010 at 01:56 PM

Problem with Date

24 Views

Hi all, I have a problem in my work, I have a field of type string that returns me the date and month / year and initial date and month / year end for the user to enter that brings relatorio.Porem the date is coming so eg 201,005 and 201,006 the first year this coming and I want to convert to ex: 052,010 and 062,010 as I remember this reversal that the field is a string of 6 and the user will have to enter.

I tried to create a method to reverse not get more if someone can help me thank you.

My method is the one below:

try{

Zrmf013_Input model = new Zrmf013_Input();

model.setPernr(pernr);

model.setBegda(wdContext.currentZrmf013_InputElement().getBegda());//pega a data do mes e ano inicial

model.setEndda(wdContext.currentZrmf013_InputElement().getEndda());//pega a data do mes e ano final

model.execute();

if (putMessages(model.getOutput().getReturn())) {

byte[] file = model.getOutput().getP_Binfile();

if (file.length > 0) {

IWDResource resource = WDResourceFactory.createCachedResource(file, pernr + ".pdf", WDWebResourceType.PDF);

wdContext.currentContextElement().setUrl(resource.toString());

} else {

wdContext.currentContextElement().setUrl("");

}

wdContext.currentContextElement().setVisibilidade(WDVisibility.VISIBLE);

}else{

wdContext.currentContextElement().setVisibilidade(WDVisibility.NONE);

}

} catch (Exception e) {

wdComponentAPI.getMessageManager().reportException(e.getMessage(), true);

}