Hello friends i want to generate csv file in my application in following format
[![enter image description here](https://i.stack.imgur.com/cooVj.png)](https://i.stack.imgur.com/cooVj.png)

Whne in android i get followign type csv
[![enter image description here](https://i.stack.imgur.com/hfwnM.png)](https://i.stack.imgur.com/hfwnM.png)

My code is a follows.

```
private class ExportDatabaseCSVTask extends AsyncTask<String, Void, Boolean>{

    File exportDir;
    File filerootAccount;
    String mStringGenerateFileName="";
    CSVWriter csvWrite;
    @Override
    public void onPreExecute() {

        mCustomProgressDialog=new CustomProgressDialog(getActivity());
        mCustomProgressDialog.show("");

    }
    public Boolean doInBackground(final String... args){

        try {

            if (mStringCurrentState.equalsIgnoreCase("Month")) {

                if (mAllMethods.isSDCARDPResent()==true) {
                 exportDir = new File(getExternalStorageDirectory()+"/Month");

            }
            else {
                 exportDir = new File(getActivity().getCacheDir() ,"/Month");

            }

            if (!exportDir.exists()) {
                exportDir.mkdirs();
            }
                 mStringGenerateFileName=String.valueOf(mTextViewChoiseTitle.getText().toString().trim())+".csv";

            filerootAccount = new File(exportDir, mStringGenerateFileName);
            System.out.println("filerootAccount "+filerootAccount.toString());

         System.out.println("mStringGenerateFileName "+mStringGenerateFileName);
         filerootAccount.createNewFile();

              csvWrite = new CSVWriter(new FileWriter(filerootAccount));

                String Title="Financial Report for  "+mTextViewTitle.getText().toString().trim();
                csvWrite.writeNext(Title);
                String Title1="Property Address :  "+mStringPropertyAddress;
                csvWrite.writeNext(Title1);
                List<CartData>mListAccount=new ArrayList<CartData>();
                CartData acc=new CartData();

                String Title11="Month : "+mTextViewChoiseTitle.getText().toString().trim();
                csvWrite.writeNext(Title11);
                // this is the Column of the table and same for Header of CSV file
                String arrStracc[] ={"Unit","Type","Income","Expense"};
                csvWrite.writeNext(arrStracc);

                CartData acc1=new CartData();   
                if (mArrayListFinRentDatas.size()>0) {
                    for (int i = 0; i < mArrayListFinRentDatas.size(); i++) {
                        acc1.setAmount(mAllMethods.AmountForamte(mArrayListFinRentDatas.get(i).getRent_amount())); 
                        acc1.setEtype(mArrayListFinRentDatas.get(i).getIncome_cat()); 
                        mListAccount.add(acc1);

                         String arrStr[] ={mArrayListFinRentDatas.get(i).getUnit_name(), mArrayListFinRentDatas.get(i).getIncome_cat(),mAllMethods.AmountForamte(mArrayListFinRentDatas.get(i).getRent_amount())};
                         csvWrite.writeNext(arrStr);
                    }

                }

                 if (mArrayListFinExpenseDatas.size()>0) {
                     for (int i = 0; i < mArrayListFinExpenseDatas.size(); i++) {
                            acc.setAmount(mAllMethods.AmountForamte(mArrayListFinExpenseDatas.get(i).getE_amount())); 
                            System.out.println("Types "+mArrayListFinExpenseDatas.get(i).getExpense_cat());
                            acc.setEtype(mArrayListFinExpenseDatas.get(i).getExpense_cat()); 
                            mListAccount.add(acc);

                             String arrStr[] ={mArrayListFinExpenseDatas.get(i).getUnit_name(), mArrayListFinExpenseDatas.get(i).getExpense_cat(),"",mAllMethods.AmountForamte(mArrayListFinExpenseDatas.get(i).getE_amount())};
                             csvWrite.writeNext(arrStr);
                        }

                }

                 String arrStr4[] ={ "Total","",mAllMethods.AmountForamte(mStringFinalTotalIncome),mAllMethods.AmountForamte(mStringFinalTotalExpense) };
                 csvWrite.writeNext(arrStr4);

                List<CartData>mListAccount16=new ArrayList<CartData>();
                CartData acc161=new CartData();
                double profit=0.0;
                profit=Double.parseDouble(mStringFinalTotalIncome)-(Double.parseDouble(mStringFinalTotalExpense) );
                  if (profit <0) {
                    double p= Math.abs(profit);
                    acc161.setEtype("Total Profit / Loss ");
                    acc161.setAmount(String.valueOf(p));

                    mListAccount16.add(acc161);

                    for(int index=0; index < mListAccount16.size(); index++)
                    {
                         acc161=mListAccount16.get(index);
                         String arrStr[] ={ acc161.getEtype(),"","","Loss" ,mAllMethods.AmountForamte(acc161.getAmount())};
                         csvWrite.writeNext(arrStr);
                    }
                }
                  else if (profit ==0) {
                    acc161.setEtype("Total Profit / Loss ");
                    acc161.setAmount("0.00");
                    mListAccount16.add(acc161);

                    for(int index=0; index < mListAccount16.size(); index++)
                    {
                         acc161=mListAccount16.get(index);
                         String arrStr[] ={ acc161.getEtype(),"","","" ,mAllMethods.AmountForamte(acc161.getAmount())};
                         csvWrite.writeNext(arrStr);
                    }
                }

                else {
                    acc161.setEtype("Total Profit / Loss ");
                    acc161.setAmount(String.valueOf(profit));
                    mListAccount16.add(acc161);
                    for(int index=0; index < mListAccount16.size(); index++)
                    {
                          acc161=mListAccount16.get(index);

                         String arrStr[] ={ "Total Profit / Loss","", "","",mAllMethods.AmountForamte(acc161.getAmount())};
                         csvWrite.writeNext(arrStr);
                    }
                }

            }

            csvWrite.close();
            return true;
        }
        catch (IOException e){
            Log.e("MainActivity", e.getMessage(), e);
            return false;
        }
    }

    @Override
    public void onPostExecute(final Boolean success)    {

        mCustomProgressDialog.dismiss("");
        if (success){
            System.out.println("Expeort");
            Toast.makeText(getActivity(), "Financial report exported successfully.", Toast.LENGTH_SHORT).show();
        }
        else {
            mAllMethods.ShowDialog(getActivity(), "Suceess", "Export failed!", "OK");
        }
    }
}

```

My issue is i want my csv format text with bold and bigger size and also with different color as per first image so how can i make it possible ? your all suggestions are appreciably.
['https://Stackoverflow.com/questions/33749645', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1461486/']
use these lines of code for using **HttpURLConnection**

For sending the request parameter are as:-

```
  Uri.Builder builder = new Uri.Builder()
                    .appendQueryParameter("phone", number)
                    .appendQueryParameter("password", password)
                    .appendQueryParameter("device_login",value);

```

And for the getting the request parameter in the post method of connectionUrl are as follow:-

```
URL url = new URL(myurl);
        HttpURLConnection urlConnection = (HttpURLConnection)     url.openConnection();
        urlConnection.setReadTimeout(30000);
        urlConnection.setConnectTimeout(30000); ;
        String query = builder.build().getEncodedQuery();

                System.out.println("REQUEST PARAMETERS ARE===" + query);
                urlConnection.setRequestMethod("POST");
                urlConnection.setDoInput(true);
                urlConnection.setDoOutput(true);

                urlConnection.connect();

                //Send request
                DataOutputStream wr = new DataOutputStream (
                        urlConnection.getOutputStream ());
                wr.writeBytes (query);
                wr.flush ();
                wr.close ();

                //Get Response
                InputStream isNew = urlConnection.getInputStream();
                BufferedReader rd = new BufferedReader(new InputStreamReader(isNew));

                String line;
                response = new StringBuffer();
                while((line = rd.readLine()) != null) {
                    response.append(line);

                }
                rd.close();

                System.out.println("Final response===="+response);

```
There might be more than one issue but a big one is you never send the request, all you are doing is creating the request and setting up the parameters

you need to do a 

```
conn.connect();

```

or

```
conn.getInputStream();

```

or any number of things you can do to send the request and get the information you require

AFTER you write your params