Search Results

Search found 15316 results on 613 pages for 'coding style'.

Page 94/613 | < Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >

  • How to set header font style as bold for the header of the table in a pdf file, in jsf

    - by Radhika
    Hi I have used PdfPTable to convert table data into a pdf file using com.itextpdf.text.pdf.PdfPTable. Table is displaying, but table data and the header are in same style. To make difference i have to set the header font style to bold. can anybody help me out in this, I have attached my code here.. Thanks in advance import java.awt.Color; import java.util.ArrayList; import java.util.List; import javax.faces.model.ListDataModel; import com.mypackage.core.filter.domainobject.FilterResultDO; import com.itextpdf.text.Font; import com.itextpdf.text.FontFactory; import com.itextpdf.text.Phrase; import com.itextpdf.text.pdf.PdfPTable; public class PDFGenerator { //This method will generate PDF for Filter Result Screen (only DataTable level) @SuppressWarnings("unchecked") public static PdfPTable generatePDF(PdfPTable table,List filterResultDOList ,List filterResultHeaderList ) { //Initialize the table with number of columns required for the Datatable header int numberOfFilterLabelCols = filterResultHeaderList.size(); //PDF Table Frame table = new PdfPTable(numberOfFilterLabelCols); //Getting Filter Detail Table Heading for(int i = 0 ; i < numberOfFilterLabelCols; i++) { ColumnHeader commandHeaderObj = filterResultHeaderList.get(i); table.addCell(commandHeaderObj.getLabel()); } //Getting Filter Detail Data (Rows X Cols) FilterResultDO filterResultDOObj = filterResultDOList.get(0); List filterResultDataList = filterResultDOObj.getFilterResultLst(); int numberOfFilterDataRows = filterResultDataList.size(); //each row iteration for(int row = 0; row < numberOfFilterDataRows; row++) { List filterResultCols = filterResultDataList.get(row); int numberOfFilterDataCols = filterResultCols.size(); //columns iteration of each row for(int col = 0; col < numberOfFilterDataCols ; col++) { String filterColumnsValues = (String) filterResultCols.get(col); table.addCell(filterColumnsValues); } } return table; }//generatePDF }

    Read the article

  • Cognos 8.3: Can I use parameters in conditional style expressions?

    - by Jacob
    Hi, I have Start Date and End date parameters that work fine as filters on a query, as follows: [EMR Reporting].[Appointments].[Appointment Date] between ?Start Date? and ?End Date? But when I attempt to apply conditional styles to a field based on ?Start Date?, the report blows up. Should I be able to use parameter values in conditional style expressions, or is this not supported for some reason? Thanks!

    Read the article

  • Which is faster for large "for" loop: function call or inline coding?

    - by zaplec
    Hi, I have programmed an embedded software (using C of course) and now I'm considering ways to improve the running time of the system. The most important single module in my system is one very large nested for loop module. That module consists of two nested for loops that loops max 122500 times. That's not very much yet, but the problem is that inside that nested for loop I have a function call to a function that is in another source file. That specific function consists mostly of two another nested for loops which loops always 22500 times. So now I have to make a function call 122500 times. I have made that function that is to be called a lot lighter and shorter (yet still works as it should) and now I started to think that would it be faster to rip off that function call and write that process directly inside those first two for loops? The processor in that system is ARM7TDMI and its frequency is 55MHz. The system itself isn't very time critical so it doesn't have to be real time capable. However the faster it can process its duties the better. Also would it be also faster to use while loops instead of fors? And any piece of advice about how to improve the running time is appreciated. -zaplec

    Read the article

  • How are operating Systems created? Which language is chosen for coding?

    - by Nitesh Panchal
    Hello, How is a basic OS created? In which language do programmers code for OS? C or Assembly? or which? Also, Assembly has limited instruction set like mov etc. So how can anybody create OS in assembly? and even C has limited functionality. But it is said to be the mother of all languages. How can anybody create a full OS with stunning graphics in C? It's simply out of my mind. And what is time duration it takes for a very basic OS to be created? unlike Windows 7 :p

    Read the article

  • How to avoid hard coding credentials into Sharepoint webpart?

    - by SeeBees
    I am building a Sharepoint web part that will be used by all users. The web part connects to a web service which needs credentials with higher privileges than common users. I hard coded credentials in the web part's code. query.Credentials = new System.Net.NetworkCredential("username", "password", "domain"); query is an instance of the web service class This may not be a good approach. In regard with security, source code of the web apart is available to people who are not allowed to see the credential. This is bad enough, But is there any other drawback of this approach? A web part doesn't have a .config file associated. The .config file is in application-level of the sharepoint site, and I don't want to modify it for a single webpart. I wonder if there is a webpart-specific way to solve this problem? Say provide a WebBrowsable property to an admin so that he/she can set credentials. Is this possible? Thanks

    Read the article

  • Visual Studio support for coding in CIL/IL/MSIL?

    - by jdk
    For the longest time I've been curious to code in Intermediate Language just as an academic endeavour and to gain a better understanding of what's "happening under the hood". Is there any sort of Visual Studio support for this in the form of: project templates, IntelliSense integration, and those kind of RAD features?

    Read the article

  • How to load cascading style sheet into C# object?

    - by Krishnaraj
    Hello, I am developing a web application, where i want to give freedom of changing style elements of css linked to a page via an admin screen. So I am wondering is there any way I can load CSS file into a C# object or into XML passable formate and update it from the admin screen inputs? Thank you, Krishnaraj

    Read the article

  • What is the best practice when coding math class/functions ?

    - by Isaac Clarke
    Introductory note : I voluntarily chose a wide subject. You know that quote about learning a cat to fish, that's it. I don't need an answer to my question, I need an explanation and advice. I know you guys are good at this ;) Hi guys, I'm currently implementing some algorithms into an existing program. Long story short, I created a new class, "Adder". An Adder is a member of another class representing the physical object actually doing the calculus , which calls adder.calc() with its parameters (merely a list of objects to do the maths on). To do these maths, I need some parameters, which do not exist outside of the class (but can be set, see below). They're neither config parameters nor members of other classes. These parameters are D1 and D2, distances, and three arrays of fixed size : alpha, beta, delta. I know some of you are more comfortable reading code than reading text so here you go : class Adder { public: Adder(); virtual Adder::~Adder(); void set( float d1, float d2 ); void set( float d1, float d2, int alpha[N_MAX], int beta[N_MAX], int delta[N_MAX] ); // Snipped prototypes float calc( List& ... ); // ... inline float get_d1() { return d1_ ;}; inline float get_d2() { return d2_ ;}; private: float d1_; float d2_; int alpha_[N_MAX]; // A #define N_MAX is done elsewhere int beta_[N_MAX]; int delta_[N_MAX]; }; Since this object is used as a member of another class, it is declared in a *.h : private: Adder adder_; By doing that, I couldn't initialize the arrays (alpha/beta/delta) directly in the constructor ( int T[3] = { 1, 2, 3 }; ), without having to iterate throughout the three arrays. I thought of putting them in static const, but I don't think that's the proper way of solving such problems. My second guess was to use the constructor to initialize the arrays Adder::Adder() { int alpha[N_MAX] = { 0, -60, -120, 180, 120, 60 }; int beta[N_MAX] = { 0, 0, 0, 0, 0, 0 }; int delta[N_MAX] = { 0, 0, 180, 180, 180, 0 }; set( 2.5, 0, alpha, beta, delta ); } void Adder::set( float d1, float d2 ) { if (d1 > 0) d1_ = d1; if (d2 > 0) d2_ = d2; } void Adder::set( float d1, float d2, int alpha[N_MAX], int beta[N_MAX], int delta[N_MAX] ) { set( d1, d2 ); for (int i = 0; i < N_MAX; ++i) { alpha_[i] = alpha[i]; beta_[i] = beta[i]; delta_[i] = delta[i]; } } My question is : Would it be better to use another function - init() - which would initialize arrays ? Or is there a better way of doing that ? My bonus question is : Did you see some mistakes or bad practice along the way ?

    Read the article

  • Excel 2008 Cant Parse HTML

    - by VictorV
    I need to export a gridview to excel, I put the return html code from the gridview to a HtmlTextWriter and put this into the response. The result file work fine in excel, excel can parse the html and the result is readable, work perfect on excel 2003 and 2007, but in some machines with Excel 2008 (MACOS) excel shows only the raw html code and can't process this html code. Any idea to configure excel? This is the code to convert: public static void ToExcel(GridView gridView, string fileName) { HttpResponse response = HttpContext.Current.Response; response.Clear(); response.Buffer = true; fileName = fileName.Replace(".xls", string.Empty) + ".xls"; response.AddHeader("content-disposition", "attachment;filename=" + fileName); response.Charset = ""; response.ContentEncoding = Encoding.Unicode; response.BinaryWrite(Encoding.Unicode.GetPreamble()); response.ContentType = MimeTypes.GetContentType(fileName); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); gridView.AllowPaging = false; //gridView.DataBind(); //Change the Header Row back to white color gridView.HeaderRow.Style.Add("background-color", "#FFFFFF"); //Apply style to Individual Cells for (int i = 0; i < gridView.HeaderRow.Cells.Count; i++) { gridView.HeaderRow.Cells[i].Style.Add("background-color", "yellow"); } for (int i = 0; i < gridView.Rows.Count; i++) { GridViewRow row = gridView.Rows[i]; //Change Color back to white row.BackColor = System.Drawing.Color.White; //Apply text style to each Row row.Attributes.Add("class", "textmode"); //Apply style to Individual Cells of Alternating Row if (i % 2 != 0) { for (int j = 0; j < row.Cells.Count; j++) { row.Cells[j].Style.Add("background-color", "#C2D69B"); } } } gridView.RenderControl(hw); //style to format numbers to string string style = @"<style> .textmode { mso-number-format:\@; } </style>"; response.Write(style); response.Output.Write(sw.ToString()); response.Flush(); response.End(); }

    Read the article

  • javascript div movement not working

    - by William
    For some reason I can't move this div at all. Can anyone help me out with why this won't work? <!DOCTYPE html> <html lang="en"> <head> <title>Move Div Test</title> <meta charset="utf-8" /> <link href="/bms/style.css" rel="stylesheet" /> <style> body { text-align: center; background-color: #ffffff;} #box { position: absolute; left: 610px; top: 80px; height: 50px; width: 50px; background-color: #ff0000;} </style> <script type="text/javascript"> document.onkeydown=function(event){keyDown(event)}; document.onkeyup=function(event){keyUp(event)}; var box = document.getElementById('box'); var speed = 5; var keys = new Array(256); var i = 0; for (i = 0;i <= 256; i++){ keys[i] = false; } function keyDown(event){ if(!event){ //for IE event = window.event; } keys[event.keyCode] = true; } function keyUp(event){ if(!event){ //for IE event = window.event; } keys[event.keyCode] = false; } function update(){ if(keys[37]) box.style.left = parseInt(box.style.left) - speed + "px"; if(keys[39]) box.style.left = parseInt(box.style.left) + speed + "px"; if(keys[38]) box.style.top = parseInt(box.style.top) - speed + "px"; if(keys[40]) box.style.top = parseInt(box.style.top) + speed + "px"; } setInterval('update();', 1000/60); </script> </head> <body> <div id="box">blah</div> </body> </html>

    Read the article

  • How can i do re coding without assign null value?

    - by Phsika
    How can i do below without assign null value "Tex=null"? static void Main(string[] args) { FileInfo f = new FileInfo("C:/temp/Arungg.txt"); StreamWriter Tex; Tex = null; if (!f.Exists) { f.CreateText(); } else { Tex = f.AppendText(); } Tex.WriteLine("Test1"); Tex.WriteLine("Test2"); Tex.Write(Tex.NewLine); Tex.Close(); Console.WriteLine(" The Text file named Arungg is created "); }

    Read the article

  • Minor tweak to this javascript function?

    - by RKS
    I have a script that shows/hides used via onClick. I can get it to show/hide just fine, but I can't get it to show/'hide everything else'. So what I get is a bunch of open containers when I really want just the one. Javascript: <script> function showfields(fields){ if(document.getElementById(fields).style.display=='none'){ document.getElementById(fields).style.display='block'; } else{ document.getElementById(fields).style.display = 'none'; } } </script> HTML: <div id="hidden" class="steps" style="display: block;"> <div class="section" style="margin-right: 10px;"> <h2>Something</h2> </div> <button class="continue dropdown" id="showLink" onClick="showfields('hidden2');return false;" href="#">Continue</button> </div> <div id="hidden2" class="steps" style="display: block;"> <div class="section" style="margin-right: 10px;"> <h2>Something2</h2> </div> <button class="continue dropdown" id="showLink" onClick="showfields('hidden3');return false;" href="#">Continue</button> </div> <div id="hidden3" class="steps" style="display: block;"> <div class="section" style="margin-right: 10px;"> <h2>Something3</h2> </div> <button class="continue dropdown" id="showLink" onClick="showfields('hidden3');return false;" href="#">Continue</button> </div> <div id="hidden4" class="steps" style="display: block;"> <div class="section" style="margin-right: 10px;"> <h2>Something4</h2> </div> <button class="continue dropdown" id="showLink" onClick="showfields('hidden4');return false;" href="#">Continue</button> </div> Thanks

    Read the article

< Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >