map url not showing on browserfield - blackberry

I've display a webpage using browserfield. It showing all webpage successfully.
But when i pass the this url ,http://maps.doapps.com/traffic/traffic.php?lat=44.972000&lng=-93.283997.
The map didnot show. only the String show as "Map div". In browser the map is show. but not in browserfield.
My code is,
BrowserFieldConfig config = new BrowserFieldConfig();
String userAgent = "BlackBerry" + DeviceInfo.getDeviceName() + "/" + DeviceInfo.getSoftwareVersion() +" Profile/" + System.getProperty("microedition.profiles") +" Configuration/" + System.getProperty( "microedition.configuration") + " VendorID/" + Branding.getVendorId();
config.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
config.setProperty(BrowserFieldConfig.USER_AGENT, userAgent);
BrowserField myBrowserField = new BrowserField(config);
myBrowserField.requestContent("http://maps.doapps.com/traffic/traffic.php?lat=44.972000&lng=-93.283997");
How to show the url in bb browserfield, any setting need to add?

BlackBerry Browser Field not support fully JQuery . so may be the problem caused by BrowerField jQuery support .
you can use static maps to display what you need . or invoking Maps installed on your device .

Related

Render rdlc reports to PDF not working on azure websites

I am having the following issue with my rdlc reports. I am creating an asp.net MVC application and need to use reports. All my reports work fine on my local machine, but on azure website I get the always this error:
Error.
An error occurred while processing your request.
On my azure bin folder I have the following dll's
Microsoft.ReportViewer.Common
Microsoft.ReportViewer.DataVisualization
Microsoft.ReportViewer.ProcessingObjectModel
Microsoft.ReportViewer.WebForms
Microsoft.ReportViewer.WinForms
and have a folder Reports with all my reports in it.
I also have change my reports properties Build Action to content and still nothing. Does any one know how can I resolve this issue.
The code that I am using and works fine on my localhost
LocalReport lr = new LocalReport();
string path = System.IO.Path.Combine(Server.MapPath("~/Reports"), "Model1.rdlc");
if (System.IO.File.Exists(path))
{
lr.ReportPath = path;
}
else
{
return View();
}
ReportDataSource rd = new ReportDataSource("Model1");
lr.DataSources.Add(rd);
string reportType = id;
string mimeType;
string encoding;
string fileNameExtension;
string deviceInfo =
"<DeviceInfo>" +
" <OutputFormat>" + id + "</OutputFormat>" +
" <PageWidth>8.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.2in</MarginTop>" +
" <MarginLeft>0.1in</MarginLeft>" +
" <MarginRight>0.1in</MarginRight>" +
" <MarginBottom>0.3in</MarginBottom>" +
" <orientation>Landscape</orientation>" +
"</DeviceInfo>";
Warning[] warnings;
string[] streams;
byte[] renderedBytes;
renderedBytes = lr.Render(
reportType,
deviceInfo,
out mimeType,
out encoding,
out fileNameExtension,
out streams,
out warnings);
return File(renderedBytes, mimeType);
Azure App Service Apps run in a secure environment called a sandbox to isolate apps.
This sandbox is blocking various APIs calls, like GDI+ APIs.
The problem might come from this limitation.
Please see the following documentation page for more détails: https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox

How to display a webpage content in my blackberry browserfield after getting an Http response?

Im making an Http request where it needs authentication. After succesffully authenticated im getting a response code as 200. Then, how should i display the webpages from the server on to my customized browser field.
To display a web page on BlackBerry Screen you can check How to - Invoke the browser,If you are working on BlackBerry OS 5.0 you can use Browser field article. Use BrowserField class to display a webpage on your BlackBerry Screen.
Here a simple fragment of code that uses BrowserField to display an html page:
BrowserField browser = new BrowserField();
String browserContent = "<html><style>" + theStyle + "</style>" + theBody + "</html>";
byte[] contentBytes;
try {
contentBytes = browserContent.getBytes("UTF-8");
browser.displayContent(contentBytes, "text/html; charset=UTF-8", "http://mysite.org");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
browser.displayContent(browserContent, "http://mysite.org");
}

Export a excel file and save witout any dialog?

I am exporting a excel file using the responce object like,
response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ";");
It is opening a dialog box (open/save/cancel).But Now I don't need the dialog box.
I want to directly SAVE file without dialog. Can any body help me out with some code link/any?
It is not possible. Sorry, but what do you think if you open web page and this page write some file on you hard drive?
This might solve your problem:
Response.ClearContent();
Response.AddHeader("Content-type", "application/vnd.ms-excel");
Response.AddHeader("content-disposition", "attachment;filename=Export.xls");
Response.ContentType = "application/excel";
var swr = new StringWriter();
var tw = new HtmlTextWriter(swr);
grd.RenderControl(tw);
Response.Write(swr.ToString());
Response.Flush();
Response.End();
tw.Close();
swr.Close();

Embedded browser control does not display

Basically I embedded a browser into my application. However the request I want to view (google) does not show in the application despite my code linking to it. Any ideas?
BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();
myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_POINTER);
BrowserField browserSession = new BrowserField(myBrowserFieldConfig);
//browserSession.
browserSession.requestContent( "http://www.google.com" );
add(browserSession);**
It need MDS service to be running. Check for MDS. it will work.

application/pdf object opening in adobe reader but not in firefox browser tab asp.net mvc

I have my controller action method returning pdf file as
public FileContentResult GetPDF(string filename)
{FileContentResult filecontent= new FileContentResult(Contents, "application/pdf");
HttpContext.Response.AddHeader("Content-Disposition", "inline; filename=" + filename);
return filecontent;
}
here Contents is byte[] type.
If in my Adobe reader Edit->Preferences->Internet unchecked the "Display PDF in the browser" opens file but not with the filename in Adobe Reader. and if I checked that then it is not opening in Browser Tab for this I also tried with opening pdf file from a website it opened it browser tab so no issues with browser.
I need to be able to open pdf in browser tab with file name. can anybody help me because i find no solution after lot of search. Is iframe setting needed?
try this if it works,
return File(filecontent,mimetype,filename);
or use FileStreamResult , idon't what exactly it does but try ,may works
regards,
kris

Resources